module documentation

Generate code diffs for opcode changes between Python versions. Automates some of the tedious work of updating pytype to support a new Python version. This script should be run from the command line as: python generate_opcode_diffs.py {old_version} {new_version} For example, to generate diffs for updating from Python 3.8 to 3.9, use "3.8" for {old_version} and "3.9" for {new_version}. Requirements: * Python 3.7+ to run this script * Python interpreters for the versions you want to diff The output has three sections: * "NEW OPCODES" are new opcode classes that should be added to pyc/opcodes.py. * "OPCODE MAPPING DIFF" is the content of a dictionary of opcode changes. Just copy the python_{major}_{minor}_mapping definition in pyc/opcodes.py for the previous version, change the version numbers, and replace the diff - it'll be obvious where it goes. Then add the new mapping to the mapping dict in the top-level dis function in the same module. * "OPCODE STUB IMPLEMENTATIONS" are new methods that should be added to vm.py. If the output contains "NOTE:" lines about modified opcodes, then there are opcode names that exist in both versions but at different indices. For such opcodes, the script generates a new class definition for pyc/opcodes.py but does not generate a new stub implementation for vm.py.

Function generate_diffs Generate diffs.
Function main Undocumented
def generate_diffs(argv): (source)

Generate diffs.

def main(argv): (source)

Undocumented