4 ms·
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.
by mark-r 11y ago
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.
- 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.