python _2or3 module?
I am writing a module to let me write code in python 3, but still run it in 2. It looks surprisingly easy actually... anything else I should add? From my (limited) flailing on the interactive interpreter, the future imports do not affect python 3 and are viewed as redundant. # _2or3.py ''' Common usage: from __future__ import print_function, nested_scopes, division, absolute_import, unicode_literals from _2or3 import * ''' import sys if sys.version[0] == '2': range = xrange input = raw_input Obviously there are some things you cannot do that you would normally be able to do in 3 (like