On Sun, Nov 4, 2012 at 1:49 PM, anatoly techtonik email@example.com wrote:
if sys.py3k: # some py2k specific code
(I assume your comment has a numeric typo?)
You would need that attribute to also be present in Python 2.x for your snippet to work, and my understanding is that 2.x is closed to feature additions.
"py3k" is a nickname/codename that not everyone using Python 3 may know about.
- sys.version_info >= (3, 0) or sys.version == '3' is harder to
trace when you need to find all python 3 related hacks
Rebutted: "There should be one-- and preferably only one --obvious way to do it." Apparently we already have at least 2 ways to do it; let's not muddle things further by adding yet another.