[Python-ideas] Dump .pyo and the "optimize" flag

Antoine Pitrou solipsis at pitrou.net
Tue Feb 2 16:16:41 CET 2010

Larry Hastings <larry at ...> writes:
> I ask you: why gunk up the filesystem with two files when one would do?  
> I propose we change the pyc file so it can contain multiple code 
> objects.

I think we should dump the lie about "optimized" bytecode when the only
optimization is that we strip some docstrings, disable asserts and set __debug__
to False.

There should be only one possible bytecode file (XXX.pyc), and we could provide
a "strip" tool (and/or corresponding function in the compileall module) for
people for whom minimizing bytecode file size is important.

Also, it would be interesting to know who bothers to use "python -O" (or "-OO").
I know I never use it.


More information about the Python-ideas mailing list