--strict mode aims for full Python interoperability, even at the expense of performance, whilst the
-O mode is, like gcc's
The majority of Python 2.5, and parts of Python 2.6 syntax are supported, including yield despite only one web browser engine having support for ECMAScript "yield" (which is not used). The yield support is
implemented as a state machine, rewriting the code so that it is re-entrant, and can resume on each yield. The features not supported are pretty small and obscure, and include for example, at the time of writing,
assignment to variables of list items in for-loop syntax is not (
for [a, b] in enumerate(l)), whereas
assignment to tuples is (
for (a, b) in enumerate(l)). Overall it is best to read the Migration Guide and go from there.
base64.py binascii.py csv.py datetime.py math.py md5.py os.py _random.py random.py re.py sets.py struct.py sys.py time.py urllib.py
Here, also, is a list of supported built-in functions, classes and types. Again: these have been contributed by various pyjs developers, and again, if there is a particular function or feature missing, it can be submitted as a contribution on GitHub.
__import__ abs all any bool callable chr cmp delattr dir divmod enumerate filter float getattr hasattr hash hex isinstance issubclass iter len map max min oct open ord pow property range reduce repr reversed round setattr sorted staticmethod str sum super type xrange zip
ArithmeticError AttributeError BaseException Exception GeneratorExit ImportError IndexError KeyError LookupError NameError NotImplemented NotImplementedError NotImplementedType RuntimeError StandardError StopIteration TypeError ValueError ZeroDivisionError
dict frozenset int list long object set tuple