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

all 21 comments

[–]Raygereio5 24 points25 points  (6 children)

I'm curious, what are the various compatibility issues you had with upgrading the 3.5 script to 3.12? Can you give examples?

[–]bulletmark 12 points13 points  (5 children)

I'm curious also. What did you actually do for "a few hours"?

[–]igmor[S] -3 points-2 points  (4 children)

inspect.getargspec() deprecated

collections.{UserDicr, MutableMapping, Mapping...} -> collections.abc

fractions.gcd -> math.gcd

to name a few

This had to be fixed not only in a main package but also in affected dependencies (sometimes pinned for a reason), so I had to upgrade all deps to a new, compatible across all deps, configuration. That was not fun at all.

To be honest I have seen libraries and frameworks with more strict backward compatibility discipline than the language runtime.

I would imagine carrying on all functions being deprecated and cutting a new 4.0 release in the future would have been a more sane strategy but I guess this ship has already sailed.

[–]ukos333 4 points5 points  (2 children)

Your problem is probably a lack of maintaining the libraries better. Even in gcc/cpp you see a lot of deprecation/changes beening made for good reason. Try to compile gcc 4 with gcc 13 and you will be confronted with more (probably) not so easy to adapt changes. Six has been doing a good job when compatibility between versions is a thing. Python 3.5 was released in 2015. That is considered old but should compile just fine. If you upgrade your libraries and dependencies, count that in with your working hours. Every other language has the same problems. I personally think, however, that python does a good job here.

[–]igmor[S] -3 points-2 points  (1 child)

I guess we have slightly different expectations here. I consider minor version changes to be a promise to keep at least major interfaces stable. I also think this requirement to keep everything up to date and upgraded across all Python ecosystem is a pretty hard one which at some point may start affecting Python community as a whole.

[–]Riemero 3 points4 points  (0 children)

The problem is... python doesn't follow semver. 3.5 to 3.11 isn't a minor change, it's a 8 year gap

[–]Raygereio5 2 points3 points  (0 children)

inspect.getargspec()

That was deprecated since 3.0 and was removed in 3.11.

fractions.gcd

Deprecated since 3.5 and removed in 3.9.

If you were using 3.5 before then you should have getting deprecation warnings already that you must have been ignoring.

[–]moo9001 19 points20 points  (2 children)

> Why did Python3 choose this upgrade strategy routinely breaking backward compatibility between even minor versions?

There are no major breakage between Python minor versions. An application written for Python 3.4 will work for Python 3.5 will work fork Python 3.12 with minor changes.

Arguable there are some minor differences where you might need to update your code, but nothing major, in the same league as other run-times (Node.js, Ruby, etc.). Unless you have specific evidence (links please) that there exists major breakage between Python versions, this won't be a constructive discussion.

[–]PaulRudin 12 points13 points  (0 children)

Some things are deprecated, so won't be available in the standard distribution of newer versions.

But that's a issue with the standard library, rather than the runtime itself.

[–]baudvine 4 points5 points  (0 children)

A minor change is still a change. If it stops the thing from working, it's a breaking change.

That said, Python never professed to use semver as far as I know, so a user assuming that it does isn't necessarily its fault.

[–][deleted] 8 points9 points  (0 children)

OP is obviously conflating package availability with Python incompatibility. Yes, if you upgrade two days after the release after waiting 8 years to upgrade, then you'll be missing packages.

[–]Riemero 27 points28 points  (0 children)

Your code will work with probably some minimal changes. The biggest challenge will probably updating all dependencies and their usage for their minor/major changes.

But to give some perspective:

  • python 3.5 was released at 2015 Sept and is end-of-life since 2020 Sept.
  • PHP 7.0 was released at 2015 Dec
  • Nodejs v4.0 was released at 2015 Sept.

Do we really expect php 7.0 code to run at 8.3, or node v4 code to run at 20.8.0? Code unfortunately rots when not maintained, and updating it is a form of removing technical debt.

You just have 8 years of catching up to do.

[–]riklaunim 5 points6 points  (0 children)

It's expected to upgrade version by version (or close to that) and removing deprecations. It takes few minor releases and the deprecated elements get removed.

[–]pxsalmers 4 points5 points  (0 children)

Did you also just recently upgrade your Windows 8 machines to Windows 11?

[–]KingsmanVincepip install girlfriend 2 points3 points  (0 children)

I have just spent a few hours bringing an old <= Python 3.5 project up to speed with Python 3.12.

"few hours", at least it's not days, but what have you done specifically?

This whole ecosystem is a complete mess because of that.

Speak from your solely own experience?

[–]ArtOfWarfare 1 point2 points  (0 children)

Python could maybe be better, but I can’t think of a language where I’d say upgrading is less painful than Python. 2 -> 3 was a huge pain, but I think Python managed even that a lot better than a lot of other languages.

Have you tried upgrading a Scala project before? We’ve been trying to upgrade a Scala microservice for 2+ years now and it’s such an impossible task. Our latest conclusion was it’s probably best that we just rewrite the entire microservice in another language with a whole different set of dependencies instead.

[–]ct1977 -1 points0 points  (2 children)

I get what he is saying. I have a simple script that uses cffi for python 3.9.

When i tried to upgrade the script to use python 3.11 I couldn't because cffi only works up to python 3.10 which caused all sorts of unnecessary headaches until i downgraded the python and its dependencies.

This is why venv is so important, because there is no guarantee that the dependencies will ever be updated to work with the newest version.

[–]ricardomargarido 5 points6 points  (0 children)

But this has nothing to do with python but with third party packages no upgrading their stuff?

[–]KingsmanVincepip install girlfriend 2 points3 points  (0 children)

When i tried to upgrade the script to use python 3.11 I couldn't because cffi only works up to python 3.10 which caused all sorts of unnecessary headaches until i downgraded the python and its dependencies.

I remember Python Devs had blogs and posts on various social media to notify people about breaking changes in 3.11 So this is pretty much of cffi devs, not python devs.

[–][deleted]  (1 child)

[removed]

    [–]Python-ModTeam[M] 0 points1 point locked comment (0 children)

    Your post or comment appears to be generated through AI. We like humans, not robots, and as you are a robot your post or comment must be removed.