Skip to content

cpython tool is well out of date #50

@mwichmann

Description

@mwichmann

The tool knows how to make a .pyc or .pyo file, depending on a construction variable $CPYTHON_PYC. However:

PEP 3147 introduced .pyc directories and versioning as of Python 3.2. That is, instead of foo.py being compiled to foo.pyc, it by default becomes __pycache__/foo.cpython-311.pyc IFF the compiler version is CPython 3.11.

Then PEP 488 eliminated pyo files entirely as of Python 3.5. They now use an encoding on the .pyc filename, so that foo.py compiled with optimization level 1 yields a filename __pycache__/foo.cpython-311.opt-1.pyc by default.

To be useful in a modern Python environment, those changes need to be accounted for.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions