<br><br><div><span class="gmail_quote">On 11/4/06, <b class="gmail_sendername">"Martin v. Löwis"</b> <<a href="mailto:martin@v.loewis.de">martin@v.loewis.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Fredrik Lundh schrieb:<br>>> However, I find the proposed behaviour reasonable: Python already<br>>> automatically imports the .pyc file if .py is not given and vice<br>>> versa. So why not look for .pyo if the .pyc file is not present?
<br>><br>> well, from a performance perspective, it would be nice if Python looked<br>> for *fewer* things, not more things.<br><br>That's true.<br><br>> (wouldn't transparent import of PYO files mean that you end up with a
<br>> program where some assertions apply, and others don't? could be con-<br>> fusing...)<br><br>That's also true, however, it might still be better to do that instead<br>of raising an ImportError.<br><br>I'm not sure whether a scenario were you have only .pyo files for
<br>some modules and only .pyc files for others is really likely, though,<br>and the performance hit of another system call doesn't sound attractive.<br><br>So I guess that zipimport should stop importing .pyo files if<br>
OptimizeFlag is false, then?</blockquote><div><br>Yes, I think it should. When I get around to rewriting zipimport for my import rewrite it will do this by default.<br><br>-Brett <br></div><br></div><br>