Live data from Hacker News

Code that will break in Python 4

astrofrog.github.io

11–20 of 237 posts

Re: Code that will break in Python 4

#12
post #9
post #4

Has there actually been a statement that python 4 will be backwards compatible to python 3?

I believe they said they were going to try very hard to not do major backwards compatible breaking changes again. > My current expectation is that Python 4.0 will merely be "the release that comes after Python 3.9". That's it. No profound changes to the language, no major backwards compatibility breaks - going from Python 3.9 to 4.0 should be as uneventful as going from Python 3.3 to 3.4 (or from 2.6 to 2.7). I even…

... thats stupid. Semver isn't that complicated, and everyone understands what 3.10 means.

Re: Code that will break in Python 4

#14
Maybe Python 4 will be properly compatible with Python 2?? Kidding.

But more seriously, probably good advice. Isn't "explicit" one of the Pythonic mantras?

But I'm wondering if any code written today really will survive until "Python 4"?

Re: Code that will break in Python 4

#15
Six is called the "Python 2 and 3 Compatibility Library" for a reason. I'm certain that when Python 4 will be released six will be updated so that six.PY3 will include Python 4.

Of course, this opens the opportunity for two other compatibility libraries. "twelve" will be for supporting Python 3 and 4 and "twentyfour" will support Python 2, 3, and 4 at once (I hope nobody will seriously consider a library called "eight").

Re: Code that will break in Python 4

#16
post #2

don't be silly - my code will long be replaced when python 4 comes out! it's just a temporary hack/short term solution anyway.

This is what people said to themselves when Python 3 was at the horizon...

That joke went way over your head.

Re: Code that will break in Python 4

#20

This is a surprisingly common anti-pattern. See also potential reason why there was no Windows 9 (programs checking for Windows 95/98) and various breakages for commercial programs on Linux when they check the kernel version.

Slightly related is Opera transitioning from version 9.x to 10.x: http://www.sitepoint.com/opera-10-user-agent/ (couldn't find the original dev blog)
Post reply on HN