Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpython tool is well out of date #50

Open
mwichmann opened this issue Dec 9, 2023 · 0 comments
Open

cpython tool is well out of date #50

mwichmann opened this issue Dec 9, 2023 · 0 comments

Comments

@mwichmann
Copy link
Collaborator

mwichmann commented Dec 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant