Comment by pjc50

8 years ago

Proposed solution: steal undump from emacs. https://news.ycombinator.com/item?id=13073566

Perhaps it would be possible to read in the source files, compile them, and preserve an image of the state immediately before reading input or command line.

I'm pretty sure Python 3 already does this, and that's what the __pycache__ directories it creates when running a command are for.

  • Those are only bytecode. It helps a little but you still have to load the file from the filesystem and run it on import.