Skip to content

.pyc files and bytecode changes #1090

@palaviv

Description

@palaviv

As mentioned .pyc are working now when sys.dont_write_bytecode is set to False.
I would like to make the use of .pyc files the default but I am not sure how should we follow changes in the bytecode. CPython has a magic number defined in _bootstrap_external.py that changes every time the bytecode is changed. RustPython is changing rapidly and I don't think we would like to update a magic number every change in the bytecode.

I have a few suggestion:

  • Use the git commit as the magic: Would allow multiple runs with same .pyc without code changes.
  • Use a random number on main start: Would allow only the same run of main to use the same .pyc.

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