module documentation
Python version numbers and their encoding ("magic number").
Function | magic |
Return the Python version belonging to the magic number in the pyc head. |
Constant | PYTHON |
Undocumented |
Return the Python version belonging to the magic number in the pyc head. The magic number is encoded in the first two bytes of a .pyc file. It translates to a (major, minor) version. It never has a "micro" version, because Python bytecode encoding doesn't change between micro version. Arguments: magic_word: A 16 bit number, either as an integer or little-endian encoded as a string. Returns: A tuple (major, minor), e.g. (3, 7).