4 ms·
Recent counter example: if you have python code that uses the "U" open mode (e.g. open(file, "rU")), it doesn't work anymore with 3.11. Yes, it produced a depre
by glandium 4y ago
Recent counter example: if you have python code that uses the "U" open mode (e.g. open(file, "rU")), it doesn't work anymore with 3.11. Yes, it produced a deprecation warning for a few versions, but no, your script that works in python 3.x is not guaranteed to work in 3.y. There are plenty of other examples.
- pdonis 4y ago> it produced a deprecation warning for a few versions Eight, to be exact: 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10. Python 3.3 was released more than 10 years ago. That's a long time for a feature to be deprecated before being removed altogether. > your script that works in python 3.x is not guaranteed to work in 3.y True, not "guaranteed" in every single respect. But spotting and fixing a deprecation warning is pretty simple. So are fixes for other examples of feature removals (and I don't think there are that many in Python 3). That's nothing like the picture the author was painting; he was talking as if code needs to be "ported" between each version, which is just nonsense.
- erik_seaberg 4y ago3.0 or 4.0 is the time to drop a user-facing feature. If 3.11 is not backward compatible, they aren’t following semver. I won’t assume every minor version bump must break stuff, but I have to be aware that it might and budget time for fixes.
- okasaki 4y agoDoes Python claim to follow semver? If not then I'm not sure what your point is.
- erik_seaberg 4y agoFrom https://peps.python.org/pep-0006/ https://peps.python.org/pep-0006/ it seems that 3.10.9 is expected to be compatible with 3.10.8, but users need to treat 3.11.0 like a potentially major rather than minor release. I wish they had labeled it 311.0 to communicate this and set expectations.
- pdonis 4y agoPEP 006 describes the way Python versioning has worked since Python was first released. Yes, it's technically not quite the same as current semver, but current semver didn't exist anyway back then.
- acdha 4y agoThat's a decade to make a 30 second change. Add something like https://github.com/asottile/pyupgrade https://github.com/asottile/pyupgrade to your pre-commit hooks and you won't even need 25 of those seconds.