4 ms·
Unless Python 4 is 100% compatible with Python 3, I hope they wouldn't overload that constant!
by wspeirs 11y ago
Unless 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.