[Python-Dev] __file__

Ian Bicking ianb at colorstudy.com
Sat Feb 27 01:58:59 CET 2010


The one issue I thought would be resolved by not easily allowing
.pyc-only distributions is the case when you rename a file (say
module.py to newmodule.py) and there is a module.pyc laying around,
and you don't get the ImportError you would expect from "import
module" -- and to make it worse everything basically works, except
there's two versions of the module that slowly become different.  This
regularly causes problems for me, and those problems would get more
common and obscure if the pyc files were stashed away in a more
invisible location.

I can't even tell what the current proposal is; maybe this is
resolved?  If distributing bytecode required renaming pyc files to .py
as Glenn suggested that would resolve the problem quite nicely from my
perspective.  (Frankly I find the whole use case for distributing
bytecodes a bit specious, but whatever.)

-- 
Ian Bicking  |  http://blog.ianbicking.org  |  http://twitter.com/ianbicking


More information about the Python-Dev mailing list