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 "eigh…
Unless Python 4 is 100% compatible with Python 3, I hope they wouldn't overload that constant!
Code that will break in Python 4
31–40 of 237 posts
Re: Code that will break in Python 4
#32Re: Code that will break in Python 4
#33Six 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 "eigh…
Unless Python 4 is 100% compatible with Python 3, I hope they wouldn't overload that constant!
Re: Code that will break in Python 4
#34Re: Code that will break in Python 4
#35Often I discover projects that are still in v2, and no words about v3 on their roadmap. Maybe v4 should learn from JavaScript5 and Visual Basic 3-6. Support v2 syntax out of the box using a (slow) shim layer if there is no "use strict" in the first line. If that statement is present, don't load the shim layer and support only v4 syntax (faster). That way old v2 code would still work without any changes.
The whole string/byte dichotomy, however, is a major change that I don't think any shim layer could handle correctly without major bugs, short of defining a whole new string-like class.
Re: Code that will break in Python 4
#36No problem! I've already fixed it so that all my code is forward compatible with Python 7000, despite not knowing what any of the syntax or library changes are going to look like.
Re: Code that will break in Python 4
#37> In this case, no code will get executed on Python 4 at all! Maybe `import six` should trigger ImportError when imported on python 4. Only "eight" or "twelve" should support Python4. :)
Re: Code that will break in Python 4
#38Holy shit - people actually write code like this?
Re: Code that will break in Python 4
#39No problem! I've already fixed it so that all my code is forward compatible with Python 7000, despite not knowing what any of the syntax or library changes are going to look like.
from __future__ import __all__Re: Code that will break in Python 4
#40Well Python doesn't use semantic versioning, but if it did, there would probably be no Python 4.0. It will just be Python 3.15, 3.16, ..., 3.99, 3.100, ...
It will become pithon.