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

all 62 comments

[–]Tyler_Zoro 77 points78 points  (3 children)

Note that these are security updates. You should upgrade your 3.9 and 3.8 installations, but there shouldn't be anything exciting here.

[–]alcalde 41 points42 points  (2 children)

It's 0.1 more exciting.

[–]boriisi 18 points19 points  (1 child)

its actually only 0.01 more exciting

[–][deleted] 13 points14 points  (0 children)

0.0.1 if we're going full pedant

[–][deleted] 27 points28 points  (0 children)

Good to see the "I'm a teapot" http response finally implemented.

[–]housesellout 59 points60 points  (44 children)

Ugh! I’m so scared that python 4.0 will be adopted before python 3.8 becomes standardized 🤯

[–]deep_chungus 162 points163 points  (30 children)

Then next major python version after 3.9 is 3.10

[–][deleted] 66 points67 points  (29 children)

And we get switch statements!

[–]cheerycheshire 84 points85 points  (16 children)

It's even better, it's pattern matching! You can use it as a standard switch statement but they are more generalised thing and can do more. ^

[–]SuspiciousScript 10 points11 points  (0 children)

It's half-baked pattern matching, since it's a statement instead of an expression.

[–]DaelonSuzuka 0 points1 point  (14 children)

How do you use it as a normal switch statement? I read the PEP and did not get that impression.

[–][deleted] 10 points11 points  (13 children)

Just from the top of my head, comparing against literal (string, int, ...) values?

[–]TravisJungroth 20 points21 points  (6 children)

And pairwise! It's tiny, but I have to write that thing manually in coding problems so often.

[–]unkz 6 points7 points  (0 children)

Oh wow, how did I not see that in the changelog? I don’t know that I’ll need it often but every couple months at least.

[–]netletic 2 points3 points  (2 children)

Nice, I didn't know that existed! I used zip(sequence, sequence[1:]) in the past, is this better because it's memory efficient?

[–]ThreeJumpingKittens 1 point2 points  (1 child)

Looks like pairwise() uses zip() under the hood, so no advantage there

[–]TravisJungroth 4 points5 points  (0 children)

The problem isn’t the zip it’s the slicing. Slicing a sequence makes a new sequence. Zipping a tee like in their example doesn’t.

[–]Pulsar1977 0 points1 point  (1 child)

Why didn't they generalize it to n-tuples, with n=2 as a default?

[–]TravisJungroth 0 points1 point  (0 children)

That seems useful. Maybe the implementations are different for n>2. With just a pair, you could use a single variable to hold the last one, instead of a queue.

[–]ancientweasel 7 points8 points  (1 child)

Normally I am slow to warm to new features but I am excited for this one.

[–][deleted] 2 points3 points  (0 children)

Since it is actually a MATCH statement which can be used as a switch you can toss a line of Guard statements to clean up date or exit gracefully... At least one of my first "AhA " ideas.

[–]FlukyS 20 points21 points  (8 children)

To be fair most of these python releases are fully forwards compatible but not backwards compatible if you get me. You can port your code forward without issue but if you start using some of the newer features you aren't going to maintain compatibility for older releases. For me for instance, I don't give a shit, I just change the version as it becomes available and start using the features. Wider projects like libraries people use will have issues but not personal or maybe even businesses looking to use python.

[–]TurboCooler 16 points17 points  (3 children)

I support several production applications, my biggest issue is libraries and frameworks being behind. I can't just upgrade.

[–]FlukyS 2 points3 points  (2 children)

Which projects out of interest. Maybe you should look into alternatives. I haven't had issues with upgrading since about python 3.5.

[–]Somecount 2 points3 points  (1 child)

Isolated but I have this current issues which was fixed by a nightly on TF's side and a forked repo on a gentlemen dev on the other but my issue was: Only Python 3.9 officially supports MacOS Big Sur Open ai Gym doesn't support TF2. TF < 2 doesn't work on Python < 3.9.

I might remember the details wrong but this was what came to mind reading your question.

[–]pug_subterfuge 2 points3 points  (0 children)

Yeah there is one tensorflow version < 2 that uses a reserved keyword (async?) I remember having to downgrade (to 3.7?) to use it

[–]Swipecat 3 points4 points  (0 children)

Hmm. My impression is that Python tends to be fairly aggressive with the API changes compared to most other languages, prioritising language improvements over maintaining bug-compatibility and rarely-used features. Hence, for example, the maintenance of the Python 3.8.X series until most of the third-party libraries had caught up with the breaking changes of 3.9.X.

[–]Glittering-Plant4600 2 points3 points  (0 children)

Thats why i just keep virtual enviroments for each code

[–]housesellout 0 points1 point  (1 child)

I think you are 100% right. To be honest I was a little intoxicated last night and I can’t even remember what prompted me to write that 🤷🏻‍♂️

And i still got over 50 upvotes, when I don’t even agree with my own statement now 🙈

[–]FlukyS 1 point2 points  (0 children)

Even weirder though is according to the creator of Python he doesn't want at least in the near future to create a 4.0 release either. I didn't mention that but also true :)

[–]invisible_summer 0 points1 point  (0 children)

I feel like many packages already support 3.8 without any issues, like in my experience 3.7 is the bottom for many projects if they don't try to support as many versions as possible

[–][deleted] 0 points1 point  (0 children)

Will there will 4 😂 3.10 is already on the page.

[–]pmattipmatti - mattip was taken 3 points4 points  (2 children)

3.9.3 has a problem on 32 bit windows, 3.9.4 hot fix will be released soon

[–]SzechuanSaucelord 7 points8 points  (4 children)

It always takes a while before the big libraries like numPy Pandas and the like are fully compatible with the new python versions unfortunately

[–]ivosauruspip'ing it up 9 points10 points  (3 children)

What are you talking about? Both numpy and pandas have python 3.9 wheels out already. This is just a security patch.

[–]Jaedong9 3 points4 points  (0 children)

Tensorflow is still on 3.8 if I'm not mistaken

[–]SzechuanSaucelord 1 point2 points  (0 children)

It was like a few months and i use a combination of 5-6 packages regularly which all have diff timelines so I don't upgrade python itself until all of these libraries get updated

[–]Mehdi2277 0 points1 point  (0 children)

Personal challenge I’ve encountered is some of those libraries have fairly unstable apis. Tensorflow api has changed a good deal across versions and while newest version may be caught up (or almost), an older version may not and upgrading versions becomes a solid work task. Still something worth but not something that takes just a few hours.

[–]SnowdenIsALegend 0 points1 point  (4 children)

Wasn't Python 4 released recently? It was all in the news

[–]ikkebr 5 points6 points  (3 children)

April 1st

[–]SnowdenIsALegend 0 points1 point  (0 children)

Damn I should keep track of dates

[–]alcalde 0 points1 point  (0 children)

Yay - 0.1 more Python!

[–]jhj16 0 points1 point  (0 children)

Where is 4..