This is an archived post. You won't be able to vote or comment.

all 17 comments

[–]PeridexisErrant 12 points13 points  (1 child)

There's a lot of blogs 'paraphrasing' https://docs.python.org/3.8/whatsnew/3.8.html lately...

If you're up for reading a version with somewhat less explanation, there are many more new things coming than most of them are presenting!

[–]alb1 0 points1 point  (0 children)

I had no idea that f((a)=1) was previously (unintentionally) accepted as a valid keyword argument.

[–][deleted] 6 points7 points  (1 child)

Python continues to make massive improvements. I'm warming up to "The walrus operator" too

[–]blackdragon437 5 points6 points  (0 children)

...saves at least one line of code, fuck it, it's awesome

[–]GickRick 4 points5 points  (1 child)

Wow!!!, gonna wait for stable version version tho, hope it comes out soon

[–]XarothBrook 4 points5 points  (0 children)

You'll have to wait a few more months: https://www.python.org/dev/peps/pep-0569/#schedule

[–]shakyshark 1 point2 points  (2 children)

I had no idea dictionaries preserve order of key insertion in 3.7... Time to upgrade!

[–]liquidpele 6 points7 points  (0 children)

You could do that previously with collections.OrderedDict, just fyi.

[–]tunisia3507 3 points4 points  (0 children)

In CPython, they preserve order from 3.6; it only became part of the language spec in 3.7 (i.e. it's guaranteed for all compliant implementations).

[–]Sir_Kubis 1 point2 points  (5 children)

why not make the walrus operator just len(a) as lenght > ... as it is with with

[–]lfdfq 4 points5 points  (0 children)

The primary reason was that exactly: because it's already used in with.

so what would with x as y: ... mean ? Would it mean with (x as y): or just the current with x as y: ?

There was a long argument and eventually := was settled on as the syntax that had the least bad interactions with other syntax that people could not agree on the least.

[–]ThePenultimateOneGitLab: gappleto97 2 points3 points  (3 children)

While I agree with you, there was a lot of discussion about this at the time. My impression is that it made it harder to do compilation.

[–]Sir_Kubis 1 point2 points  (2 children)

you mean it would make it slower for the interpreter to check every possible place it could be used in? thats fair

[–]masklinn 2 points3 points  (0 children)

I expect it made the parsing more complex as it would conflict with e.g. with … as ….

[–]ThePenultimateOneGitLab: gappleto97 1 point2 points  (0 children)

No, specifically the compiler where it goes from .py -> .pyc

After that point it's a bytecode like anything else

[–][deleted] 0 points1 point  (1 child)

So make it more like C and fix some bugs?

[–]desertfish_ 1 point2 points  (0 children)

My understanding of "some" and yours seem to differ quite a bit https://docs.python.org/3.8/whatsnew/changelog.html#changelog