Backporting of some of the features natively available in newer Python versions:
boolclass (as well asTrueandFalse)sorted()function (Python 2.4)sum()function (Python 2.3)enumerate()function (Python 2.3)print()function (keyword arguments such asendorsepwere added inPython 3.3, see module docstring for more details)NotImplementedErrorexception (Python 2.2)set()class (Python 2.4)
For a quick one-time workaround for
TrueandFalse:exec("try: (True, False)\nexcept NameError: exec('True = 1==1; False = 1==0')")