[Python-ideas] Move optional data out of pyc files

Neil Schemenauer nas-python-ideas at arctrix.com
Sat Apr 14 19:54:05 EDT 2018

On 2018-04-12, M.-A. Lemburg wrote:
> This leaves the proposal to restructure pyc files into a sectioned
> file and possibly indexed file to make access to (lazily) loaded
> parts faster.

I would like to see a format can hold one or more modules in a
single file.  Something like the zip format but optimized for fast
interpreter startup time.  It should support lazy loading of module
parts (e.g. maybe my lazy bytecode execution idea[1]).  Obviously a
lot of details to work out.

The design should also take into account the widespread use of
virtual environments.  So, it should be easy and space efficient to
build virtual environments using this format (e.g. maybe allow
overlays so that stdlib package is not copied into virtual
environment, virtual packages would be overlaid on stdlib file).
Also, should be easy to bundle all modules into a "uber" package and
append it to the Python executable.  CPython should provide
out-of-box support for single-file executables.

1. https://github.com/python/cpython/pull/6194

More information about the Python-ideas mailing list