I do not know exactly what caused this, but my internal project test-suite got a much appreciated 5% speedup! Thank you Python team!
What’s New in Python 3.8
21–30 of 381 posts
Re: What’s New in Python 3.8
#22The "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.
Re: What’s New in Python 3.8
#23Earlier 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.
Re: What’s New in Python 3.8
#24Shared Memory is the star of this release IMHO.
Re: What’s New in Python 3.8
#25Earlier 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
Re: What’s New in Python 3.8
#26The 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...
{ 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
#27They have a lot of code samples and examples about how and when to use the new features.Personally, I love the new debugging support in F strings.
Re: What’s New in Python 3.8
#28As 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…
Re: What’s New in Python 3.8
#29Earlier 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=}")?
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!).