PEP 304 - is anyone really interested?
theller at python.net
Thu Jun 23 11:20:39 EDT 2005
Thomas Guettler <guettli at thomas-guettler.de> writes:
> Am Wed, 22 Jun 2005 18:01:51 -0500 schrieb Skip Montanaro:
>> I wrote PEP 304, "Controlling Generation of Bytecode Files":
> I am interested in a small subset: I want to import a file without
> a '.pyc' being generated.
> Background: I sometimes missuse python for config files. For example
Although I was not interested originally, I think that's a use case I
also have. Optional config files, which should not be compiled to .pyc
or .pyo. Only removing the .py file doesn't have the expected effect
if a .pyc and/or .pyo if is left.
I don't think the PEP supports such a use case.
BTW: While I'me reading the PEP to check the above, I encountered this:
Add a new environment variable, PYTHONBYTECODEBASE, to the mix of
environment variables which Python understands. PYTHONBYTECODEBASE is
interpreted as follows:
If not defined, Python bytecode is generated in exactly the same
way as is currently done. sys.bytecodebase is set to the root
directory (either / on Unix and Mac OSX or the root directory of
the startup (installation???) drive -- typically C:\ -- on
If defined and it refers to an existing directory to which the
user has write permission, sys.bytecodebase is set to that
directory and bytecode files are written into a directory
structure rooted at that location.
If defined but empty, sys.bytecodebase is set to None and
generation of bytecode files is suppressed altogether.
AFAIK, it is not possible to define empty env vars on Windows.
would remove this env var instead of setting it to an empty value.
More information about the Python-list