Live data from Hacker News

What’s New in Python 3.8

docs.python.org

141–150 of 381 posts

Re: What’s New in Python 3.8

#141
post #127

Earlier quoted context omitted.

> As a developer who has primarily developed applications in Python for his entire professional career, I can't say I'm especially excited about any of the "headlining" features of 3.8. Python is a fairly old, mature language. What features would you have been especially excited about?

Though not a language feature per say, I would love if the language would take on the packaging ecosystem and deliver a ground up approach that isn't just a kludge on a kludge on a kludge.

You might like portage. We have USE flags (which are ./configure --stuff), slots (so you can install multiple versions in a clean way), and any kind of dependency tree you can think of. When I am thinking of upgrading the system python, I can enable the next version and let things simmer for testing (building for py3.7 and 3.8 for example) before I actually throw the switch (eselect python set N).

Re: What’s New in Python 3.8

#142
post #113

Earlier quoted context omitted.

IMO A better fix is to use http://attrs.org or dataclasses to replace the dicts entirely.

And then use a library like json-syntax[1] to translate those into JSON. [1]: https://pypi.org/project/json-syntax/

this looks interesting. we use cattrs, which has worked well for us but has a long-delayed 1.0 release.

Re: What’s New in Python 3.8

#143

Disappointing that Python sill has no support for a sorted container in its standard library, akin to C++ `set` or `map` classes.

https://docs.python.org/3.0/library/bisect.html

> This module provides support for maintaining a list in sorted order without having to sort the list after each insertion.

Re: What’s New in Python 3.8

#144

Disappointing that Python sill has no support for a sorted container in its standard library, akin to C++ `set` or `map` classes.

What's the value of a sorted map over an ordered map?

I don't think I've ever cared to iterate over map values based on the alphanumeric ordering of their keys.

Re: What’s New in Python 3.8

#145

Disappointing that Python sill has no support for a sorted container in its standard library, akin to C++ `set` or `map` classes.

https://docs.python.org/3.0/library/bisect.html > This module provides support for maintaining a list in sorted order without having to sort the list after each insertion.

Problem with bisect is that bisect.insort() insertion is O(n), whereas C++ set.insert() is O(log n).

Re: What’s New in Python 3.8

#146
post #56

Earlier quoted context omitted.

> which itself is a result of limiting ourselves to the ASCII symbols that can be typed I think we're ready for programming languages using some visually good Unicode characters, instead of overloading `[]{}!@#$%^&*()-_/` for everything!

There are programming fonts that use ligatures to convert >= to ≥, or -> to →, so the source code remains in ASCII but symbol sequences show as unique Unicode characters. A next step could be for common dev environments to actually convert symbol/key sequences to operators (how do APL programmers do it?) Avoiding ambiguity and semantic overloading of ASCII symbols would surely help beginners (if also given a UI that…

> There are programming fonts that use ligatures to convert >= to ≥

It's a neat hack, but that's the opposite of what I want. It means I can't look at source code and know what characters make it up, which is the primary reason I'm still putting up with plain text files (and mostly ASCII) for source code at all.

Out of habit, I occasionally type some control-letter combination which is a valid command in Emacs, but in Xcode (and other native Mac apps) inserts an invisible character, which happens to be invalid in Swift. 10 minutes later, I get a compilation error pointing at a line of code that looks perfectly valid. Frustrating!

Re: What’s New in Python 3.8

#147
post #30

def f(a, b, /, c, d, *, e, f): Wow: IMHO that is a very ugly syntax to define a fn with 6 parameters, although it looks to be a path dependency on previous decisions (*, and CPython ,/) and clearly there was much discussion of the need for the functionality and the compromises: https://www.python.org/dev/peps/pep-0570/ It amazes me to see how certain features make it into languages via community/committee (octal numb…

> which itself is a result of limiting ourselves to the ASCII symbols that can be typed I think we're ready for programming languages using some visually good Unicode characters, instead of overloading `[]{}!@#$%^&*()-_/` for everything!

I'm experimenting with this in V [0]

  if a ≠ b {
is allowed along with

  if a != b {
vfmt (kinda like gofmt) will be able to convert != to ≠.

So far the response has been mixed.

Not everyone is open to this change.

[0] https://vlang.io

Re: What’s New in Python 3.8

#148
post #127

Earlier quoted context omitted.

> As a developer who has primarily developed applications in Python for his entire professional career, I can't say I'm especially excited about any of the "headlining" features of 3.8. Python is a fairly old, mature language. What features would you have been especially excited about?

Though not a language feature per say, I would love if the language would take on the packaging ecosystem and deliver a ground up approach that isn't just a kludge on a kludge on a kludge.

Unfortunately, that'd mean a package manager for C, Fortran, etc. as well, since so many Python packages have non-Python dependencies.

I've started using Docker for ensuring prod behaves the same as dev. Going from Mac dev to Linux prod would otherwise cause trouble.

Re: What’s New in Python 3.8

#149

Earlier quoted context omitted.

>They didn't select my preferred syntax I don't write much python so there's probably something obvious I'm missing, but I don't see why they didn't use "=". Is there some significant difference between assignment expressions and assignment statements that makes it worth having distinct syntax?

It seems if you use '=' it leads to dangerous programming bugs[1], whereas ':=' somehow prevents those bugs? [1] https://effbot.org/pyfaq/why-can-t-i-use-an-assignment-in-an...

It's so that something like this remains invalid syntax, instead of an unpleasant accident.

  x = False
  if x = True:
      sadness()

Re: What’s New in Python 3.8

#150

The expansion of f-strings is a welcome addition. The more I use them, the happier I am that they exist https://docs.python.org/3/whatsnew/3.8.html#f-strings-suppor...

Why didn’t Python ship with the opposite functionality as well? Parsing instead of formatting. Given a string and a format string, return a list of variables (or a dictionary).
Post reply on HN