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/2010-March/098152.html below:

[Python-Dev] __file__ and bytecode-only

[Python-Dev] __file__ and bytecode-onlyNick Coghlan ncoghlan at gmail.com
Thu Mar 4 14:34:10 CET 2010
Barry Warsaw wrote:
> On Mar 03, 2010, at 07:37 PM, Jim Jewett wrote:
> 
>> I understand the need to ship without source -- but why does that
>> require supporting .pyc (or .pyo) -only?
>>
>> Couldn't vendors just replace the real .py files with empty files?
> 
> Yes, I think that's a possibility.  What would people think about that?

I actually thought of this, but didn't post it because it defeats the
point of byte-code only distribution.

- putting text in the .py file will break the application
- touching the .py file in any way will break the application

If someone wants to break the bytecode only support it should be its own
PEP and not coupled with PEP 3147.

The remaining open question to my mind is whether or not there should be
a -X option to control the bytecode generation. E.g.:

-Xcache_bytecode=no (don't write bytecode files at all)
-Xcache_bytecode=file (write a classic "foo.pyc" file)
-Xcache_bytecode=dir (write to the "__pycache__" directory)

With cache_bytecode=dir being the default for future releases.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
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