Live data from Hacker News

What’s New in Python 3.8

docs.python.org

21–30 of 381 posts

Re: What’s New in Python 3.8

#21
post #6

I do not know exactly what caused this, but my internal project test-suite got a much appreciated 5% speedup! Thank you Python team!

Nice! My test suite got around 20% faster when going from 3.6 to 3.7. That’s almost like buying a whole new computer.

Re: What’s New in Python 3.8

#22
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.

The "walrus operator" will occasionally be useful, but I doubt I will find many effective uses for it. Same with the forced positional/keyword arguments and the "self-documenting" f-string expressions. Even when they have a use, it's usually just to save one line of code or a few extra characters.

The labeled breaks and continues proposed in PEP-3136 [0] also wouldn't be used very frequently, but they would at least eliminate multiple lines of code and reduce complexity.

PEP-3136 was rejected because "code so complicated to require this feature is very rare". I can understand a stance like that. Over complicating a language with rarely-used features can definitely create problems. I just don't see why the three "headline" features I mentioned are any different.

[0]: https://www.python.org/dev/peps/pep-3136/

Re: What’s New in Python 3.8

#23

Earlier quoted context omitted.

Because of the luddites at RedHat, Python2.7 isn't actually dead until 2024. It's infuriating. https://access.redhat.com/solutions/4455511

It's almost as if the Python Software Foundation isn't capable of killing the Python 2 language unilaterally without the Python community's consent.

It's almost as if people were given 12 fucking years (or admittedly fewer, depending on when your favorite library was migrated) to move over, didn't, and are now obstinately standing in the way of forward progress.

Re: What’s New in Python 3.8

#25

Earlier quoted context omitted.

Because of the luddites at RedHat, Python2.7 isn't actually dead until 2024. It's infuriating. https://access.redhat.com/solutions/4455511

the emotional content outweighs the objective situation here; also humorous since Luddites are commonly misunderstood per https://en.wikipedia.org/wiki/Luddite

Not misunderstood; luddites (lowercase l, or at least the generalized form) means something different than Luddites (capitalized L).

Re: What’s New in Python 3.8

#26

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...

I saw that and was like "Oh, that'd be a handy feature for a lot of other programming languages too." But the more I think about it, the more I'd rather have a feature that takes a list of expressions and converts it into a dict where the keys are the expression text and the values are the values of those expressions. Basically, syntactic sugar for this:

  { k: eval(k) for k in ('theta', 'delta.days', 'cos(radians(theta))') }
This would trivially subsume the f'{user=}' syntax for the example given: just print out the dictionary. But it'd also be useful for: filling template dictionaries; printing out status pages for HTTP webservers; returning multiple variables from a function; flattening out complex data structures; creating dispatch tables out of local functions.

You could even have a syntax like locals('theta', 'delta.days') and keep it familiar.

Re: What’s New in Python 3.8

#28
post #22

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. The "walrus operator" will occasionally be useful, but I doubt I will find many effective uses for it. Same with the forced positional/keyword arguments and the "self-documenting" f-string expressions. Even when they have a use, it's us…

I take this as a positive sign of Python's maturity.

Re: What’s New in Python 3.8

#29
post #13

Earlier quoted context omitted.

One thing I vastly dislike with them is that they are still expanded in logging, while they are not expanded when logging is using "the old way".

What do you mean the old way? Will it print what foo is if I type logger.info("{foo=}")?

Logging.info(“%s %s”, name, country”) the string isn’t expanded if the logging is set to warn. While with your example the string is expanded then discarded

Re: What’s New in Python 3.8

#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 numbers in JavaScript - arrgh!).

One thing I find really difficult to deal with in languages is the overloading of different syntactic(edit:semantic) usages of different symbols, which itself is a result of limiting ourselves to the ASCII symbols that can be typed. I don't recall written mathematics having the issue badly (although I haven't had to write any for a long time!).

Post reply on HN