Live data from Hacker News

What’s New in Python 3.8

docs.python.org

11–20 of 381 posts

Re: What’s New in Python 3.8

#13

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

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

#14
> The typing module incorporates several new features:

> A dictionary type with per-key types.

Ah, I've been waiting for this. I've been able to use Python's optional types pretty much everywhere except for dictionaries that are used as pseudo-objects, which is a fairly common pattern in Python. This should patch that hole nicely.

Re: What’s New in Python 3.8

#15

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

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

How would you fix the issue without breaking existing semantics?

The way I see it, it's a necessary price to pay, and I just continue to use c-style forming strings in logging.

Re: What’s New in Python 3.8

#16

This is the release that contains the controversial assignment expressions, which sparked the debate that convinced GvR to quit as BDFL. They didn't select my preferred syntax, but I'm still looking forward to using assignment expressions for testing my re.match() objects. I haven't used 3.8.0 yet but I hope its a good one because 2020 is the year that 2.7 dies and there will be a lot of people switching.

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

#17
post #14

> The typing module incorporates several new features: > A dictionary type with per-key types. Ah, I've been waiting for this. I've been able to use Python's optional types pretty much everywhere except for dictionaries that are used as pseudo-objects, which is a fairly common pattern in Python. This should patch that hole nicely.

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

Re: What’s New in Python 3.8

#18

This is the release that contains the controversial assignment expressions, which sparked the debate that convinced GvR to quit as BDFL. They didn't select my preferred syntax, but I'm still looking forward to using assignment expressions for testing my re.match() objects. I haven't used 3.8.0 yet but I hope its a good one because 2020 is the year that 2.7 dies and there will be a lot of people switching.

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

#19

Shared Memory is the star of this release IMHO.

Is shared memory one of those things that I should try to access/use immediately, or wait for someone to write a wrapper library around, due to the large number of edge cases/strangeness that might occur?

Why not both? You get a great feel for what the edge cases are and how they occur, and thus a better understanding of why decisions in "wrapper libraries" were made, when these edge cases bite you.

Re: What’s New in Python 3.8

#20
post #3

Arguably one of the hotter debated functions is assignment-as-expression through the := or walrus operator. Quite happy with the new SyntaxWarning for identity comparison on literals and missing commas :) Especially neat is also the `python -m asyncio` shell which allows you to run top-level awaits in your repl instead of needing to start a new event loop each time!

IPython has supported top-level async for a while too, plus many other features!
Post reply on HN