5 ms·
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
by bhaak 11y ago
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").
- incongruity 11y agoThe move from Python 6 to 7 will be the ultimate answer. import fortytwo
- schoen 11y agoAmusingly, the Hitchhiker's Guide itself contains a different purported "factorization" of 42: http://www.everything2.com/title/what+do+you+get+if+you+multiply+six+by+nine http://www.everything2.com/title/what+do+you+get+if+you+mult...
- wspeirs 11y agoUnless Python 4 is 100% compatible with Python 3, I hope they wouldn't overload that constant!
- wyldfire 11y agoStill wouldn't matter unless you allow for pure evil like 'import twelve as six' EDIT: wouldn't matter because "six" shouldn't allow itself to be imported on PY4.
- mark-r 11y agoYes, 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.
- kedean 11y agoThen what was the point of using the PY3 constant?
- xrstf 11y agoMaybe readability? "if six.PY3" is easier on the eyes than "if not six.PY2". At least to me. ;)
- mark-r 11y agoThe only legitimate purpose of using six.PY3 is for managing a module that runs in both Python 2 or Python 3; for that purpose it's almost essential. When Python 4 eventually comes out you may find vestiges of code that still rely on it, even though it hasn't been required for ages. If PY3 is still True, your code will continue to run just fine without changes. If you find it necessary to manage the upgrade from 3 to 4 I'm sure there will be another package available with the required constants.
- ChristianBundy 11y agoIf it was 100% compatible it wouldn't be Python 4, it'd be Python 3.x.x.
- VeilEm 11y agoSomeone recently made the argument to me that semantic version has nothing to say about increasing the major version even though there are no backwards compatible breaking changes. I am not sure what the point of increasing the major version would be in this case, and I think it's a bad idea, but I guess that person was correct in the literal sense of how semver is defined.
- Sanddancer 11y agoThere could be other reasons for a version number bump other than the python code being written, like changing the limited ABI. In such a hypothetical version, the python code would be valid, but the stuff linking to the python interpreter wouldn't be.
- detaro 11y agoPython does not follow Semantic Versioning as far as I know.
- collinmanderson 11y agoCurrently the issue is wontfix'd: https://bitbucket.org/gutworth/six/issues/22/variable-sixpy3-is-time-bomb https://bitbucket.org/gutworth/six/issues/22/variable-sixpy3... I personally doubt the author's statement: "six will be long dead and forgotten by the time Python 4 rolls around."
- phyzome 11y agoYeah. Software never dies, it just gets more unpleasant to deal with.