Earlier quoted context omitted.
Unless Python 4 is 100% compatible with Python 3, I hope they wouldn't overload that constant!
Yes, they should make the constant True for both Python 3 and Python 4. If you need to make a finer distinction, use a different package.
Code that will break in Python 4
111–120 of 237 posts
Re: Code that will break in Python 4
#112They could always take the Microsoft route: Python 4 will be internally versioned as Python 3.1 to avoid this sort of problem.
Re: Code that will break in Python 4
#113Re: Code that will break in Python 4
#114Earlier quoted context omitted.
There is a difference between writing code that might break and code that is guaranteed to break. Badly written version checks are guaranteed to break.
Which is why GetVersionEx() on Windows will always tell you that you are running Windows 8, unless your application has a manifest entry indicating specifically that it is compatible with a higher version. Microsoft thought there were too many broken version checks in the wild, so decided to hobble the version check function as a fix. I can understand why they did it.
Re: Code that will break in Python 4
#115> We don't really know yet what Python 4 will look like, but we can be pretty sure that the transition from Python 3 to Python 4 will be a lot smoother Doesn't compute. You can't say you don't know anything about Python4 and immediately follow up with suggestions on how to program for it. And if you really want to be consistent, at least: if (python2): // python 2 else if (python3): // python 3 else: raise "I have no…
Not that there aren't a lot of things _right_ with python...
Re: Code that will break in Python 4
#116They could always take the Microsoft route: Python 4 will be internally versioned as Python 3.1 to avoid this sort of problem.
Re: Code that will break in Python 4
#117Re: Code that will break in Python 4
#118> We don't really know yet what Python 4 will look like, but we can be pretty sure that the transition from Python 3 to Python 4 will be a lot smoother Doesn't compute. You can't say you don't know anything about Python4 and immediately follow up with suggestions on how to program for it. And if you really want to be consistent, at least: if (python2): // python 2 else if (python3): // python 3 else: raise "I have no…
Re: Code that will break in Python 4
#119They could always take the Microsoft route: Python 4 will be internally versioned as Python 3.1 to avoid this sort of problem.
"Version: Python 3.1 (Python 4.2)"
Re: Code that will break in Python 4
#120Earlier quoted context omitted.
Which is why GetVersionEx() on Windows will always tell you that you are running Windows 8, unless your application has a manifest entry indicating specifically that it is compatible with a higher version. Microsoft thought there were too many broken version checks in the wild, so decided to hobble the version check function as a fix. I can understand why they did it.
Hell, the reason Windows 10 is Windows 10 is because of all the bad version checks looking for "9X"