[Python-Dev] Importing .pyc in -O mode and vice versa
brett at python.org
Sat Nov 4 21:40:23 CET 2006
On 11/4/06, Osvaldo Santana <osantana at gmail.com> wrote:
> I'm the author of this patch and we are already using it in Python
> port for Maemo platform.
> We are using .pyo modules mainly to remove docstrings from the
> modules. We've discussed about this patch here before.
> Now, I agree that the zipimport behaviour is incorrect but I don't
> have other option to remove docstrings of a .pyc file.
> I'm planning to send a patch that adds a "--remove-docs" to the Python
> interpreter to replace the "-OO" option that create only .pyo files.
>  http://mail.python.org/pipermail/python-dev/2005-November/057959.html
The other option is to do away with .pyo files:
Guido has said he wouldn't mind it, but then .pyc files need to grow a field
or so to be able to store what optimizations were used. While this would
lead to more bytecode regeneration, it would help deal with this case and
allow for more optimizations on the bytecode.
On 11/4/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> > Fredrik Lundh schrieb:
> > >> However, I find the proposed behaviour reasonable: Python already
> > >> automatically imports the .pyc file if .py is not given and vice
> > >> versa. So why not look for .pyo if the .pyc file is not present?
> > >
> > > well, from a performance perspective, it would be nice if Python
> > > for *fewer* things, not more things.
> > That's true.
> Osvaldo Santana Neto (aCiDBaSe)
> Python-Dev mailing list
> Python-Dev at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev