On 8 September 2017 at 08:50, Neil Schemenauer wrote:
> This should be pretty safe to do and should give a significant
> benefit in startup time and memory usage.
And given the extended pyc header being proposed in PEP 552, we'd be
able to include flags in the header to indicate that the pyc file
This is an idea that came out of the lazy module loading (via AST
analysis), posted to python-ideas. The essential idea is to split
the marshal data stored in the .pyc into smaller pieces and only
load the parts as they are accessed. E.g. use a __getattr__ hook on
the module to unmarshal+exec the