[Python-Dev] __file__

Steven D'Aprano steve at pearwood.info
Tue Mar 2 11:06:16 CET 2010

On Tue, 2 Mar 2010 11:59:55 am Barry Warsaw wrote:
> Thanks everybody for providing great input on this aspect of the PEP.
>  I've updated the open issues section to include a list of the
> possible resolutions for bytecode-only imports.  Unless anybody has
> more ideas, it might just be time to get a BDFL pronouncement.

Please excuse me if these minor points have already been discussed, but 
I couldn't see them in the PEP.

(1) What happens if the __cache__ directory doesn't exist and the 
enclosing directory is unwriteable, or if it does exist, but is 

I expect that the byte code files will simply not be created, and 
everything will continue without them.

(2) Presumably this only effects imports, not running python source code 
as a script. If I do this:

python myscript.py

from the shell, I would expect that no __cache__ directory will be 
created, just like today. 

BTW, you have some sort of automated warning in the PEP:

System Message: WARNING/2 (pep-3147.txt, line 237)
Title underline too short.


Steven D'Aprano

More information about the Python-Dev mailing list