On 11/4/06, "Martin v. Löwis" <[EMAIL PROTECTED]> 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 looked
> for *fewer* things, not more things.

That's true.

> (wouldn't transparent import of PYO files mean that you end up with a
> program where some assertions apply, and others don't?  could be con-
> fusing...)

That's also true, however, it might still be better to do that instead
of raising an ImportError.

I'm not sure whether a scenario were you have only .pyo files for
some modules and only .pyc files for others is really likely, though,
and the performance hit of another system call doesn't sound attractive.

So I guess that zipimport should stop importing .pyo files if
OptimizeFlag is false, then?

Yes, I think it should.  When I get around to rewriting zipimport for my import rewrite it will do this by default.

-Brett


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to