<br><br><div><span class="gmail_quote">On 11/6/06, <b class="gmail_sendername">Giovanni Bajo</b> &lt;<a href="mailto:rasky@develer.com">rasky@develer.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Martin v. Löwis wrote:<br><br>&gt;&gt; Why not only import *.pyc files and no longer use *.pyo files.<br>&gt;&gt;<br>&gt;&gt; It is simpler to have one compiled python file extension.<br>&gt;&gt; PYC files can contain optimized python byte code and normal byte
<br>&gt;&gt; code.<br>&gt;<br>&gt; So what would you do with the -O option of the interpreter?<br><br>I just had an idea: we could have only pyc files, and *no* way to identify<br>whether specific &quot;optimizations&quot; (-O, -OO --only-strip-docstrings, whatever)
<br>were performed on them or not. So, if you regularly run different python<br>applications with different optimization settings, you'll end up with .pyc<br>files containing bytecode that was generated with mixed optimization
<br>settings. It doesn't really matter in most cases, after all.</blockquote><div><br>I don't know about that.&nbsp; If you suspected that a failure could be because of some bytecode optimization you were trying wouldn't you like to be able to tell easily that fact?
<br><br>Granted our situation is not as bad as gcc in terms the impact of having to regenerate a compiled version, but it still would be nice to be able to make sure that every .pyc file is the same.&nbsp; We would need to make it easy to blast out every .pyc file found if we did allow mixing of optimizations (as you suggest below).
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Then, we add a single command line option (eg: &quot;-I&quot;) which is: &quot;ignore
<br>*every* .pyc file out there, and regenerate them as needed&quot;. So, the few<br>times that you really care that a certain application is run with a specific<br>setting, you can use &quot;python -I -OO app.py&quot;.</blockquote>
<div><br>That might work.<br></div><br>-Brett<br></div>