2 ms·
it was possible to make a program that ran on both 2 and 3, but it required using "try" with no variable assignment and then digging into Python's exception ref
by icebraining 9y ago
it was possible to make a program that ran on both 2 and 3, but it required using "try" with no variable assignment and then digging into Python's exception reflection support to recover the variable.
What? The PEP that added the new syntax also added it to Python 2.6: https://www.python.org/dev/peps/pep-3110/#compatibility https://www.python.org/dev/peps/pep-3110/#compatibility