On Tue, 10 Apr 2018 11:13:01 -0700 Ethan Furman <et...@stoneleaf.us> wrote: > On 04/10/2018 10:54 AM, Zachary Ware wrote: > > On Tue, Apr 10, 2018 at 12:38 PM, Chris Angelico <ros...@gmail.com> wrote: > >> A deployed Python distribution generally has .pyc files for all of the > >> standard library. I don't think people want to lose the ability to > >> call help(), and unless I'm misunderstanding, that requires > >> docstrings. So this will mean twice as many files and twice as many > >> file-open calls to import from the standard library. What will be the > >> impact on startup time? > > > > What about instead of separate files turning the single file into a > > pseudo-zip file containing all of the proposed files, and provide a > > simple tool for removing whatever parts you don't want? > > -O and -OO already do some trimming; perhaps going that route instead of > having multiple files would be better.
"python -O" and "python -OO" *do* generate different pyc files. If you want to trim docstrings with those options, you need to regenerate pyc files for all your dependencies (including third-party libraries and standard library modules). Serhiy's proposal allows "-O" and "-OO" to work without needing a custom bytecode generation step. Regard Antoine. _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/