[Python-Dev] Unexpected bytecode difference

Alexander Belopolsky alexander.belopolsky at gmail.com
Fri Jan 19 18:46:58 EST 2018

I have encountered the following difference between Python 3 and 2:

>>> compile('xxx', '<>', 'eval').co_code

>>> compile('xxx', '<>', 'eval').co_code

Note that 'S' (the code for RETURN_VALUE) and a zero byte are swapped
in Python 2 compared to Python 3.  Is this change documented

More information about the Python-Dev mailing list