[Python-Dev] __file__ and bytecode-only

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 4 04:18:09 CET 2010


Barry Warsaw wrote:
> On Mar 03, 2010, at 07:37 PM, Jim Jewett wrote:
>
>> 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?

Seems like a perverse thing to have to do to me.

Also a bit fragile, since you would have to make
sure that the empty .py files were dated older
than the .pyc files and stayed that way, lest
Python try to recompile them and wipe out your
code.

You would also have to be careful to build
installers that didn't recompile .py files on
installation. (Haven't had much experience building
installers using distutils, so I'm not sure
how much of a problem that would be.)

-- 
Greg


More information about the Python-Dev mailing list