A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-November/069876.html below:

[Python-Dev] Importing .pyc in -O mode and vice versa

[Python-Dev] Importing .pyc in -O mode and vice versaGiovanni Bajo rasky at develer.com
Mon Nov 6 21:01:19 CET 2006
Martin v. Löwis wrote:

>> Why not only import *.pyc files and no longer use *.pyo files.
>>
>> It is simpler to have one compiled python file extension.
>> PYC files can contain optimized python byte code and normal byte
>> code.
>
> So what would you do with the -O option of the interpreter?

I just had an idea: we could have only pyc files, and *no* way to identify
whether specific "optimizations" (-O, -OO --only-strip-docstrings, whatever)
were performed on them or not. So, if you regularly run different python
applications with different optimization settings, you'll end up with .pyc
files containing bytecode that was generated with mixed optimization
settings. It doesn't really matter in most cases, after all.

Then, we add a single command line option (eg: "-I") which is: "ignore
*every* .pyc file out there, and regenerate them as needed". So, the few
times that you really care that a certain application is run with a specific
setting, you can use "python -I -OO app.py".

And that's all.
-- 
Giovanni Bajo

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4