[Python-ideas] sys.py3k

anatoly techtonik techtonik at gmail.com
Sun Nov 4 22:49:24 CET 2012


if sys.py3k:
  # some py2k specific code
  pass


Why?
 1. readable
 2. traceable

Explained:
 1. self-explanatory
 2. sys.version_info >= (3, 0) or  sys.version[0] == '3' is harder to
trace when you need to find all python 3 related hacks

--
anatoly t.



More information about the Python-ideas mailing list