[Python-Dev] pycache creation (original) (raw)

Barry Warsaw barry at python.org
Wed Mar 24 13:09:37 CET 2010


On Mar 23, 2010, at 08:42 PM, Ron Adam wrote:

It looks like, while developing a python 3.2+ program, if you don't create an empty pycache directory, everything will still work, you just won't get the .pyc files. That can be a good thing during development because you also will not have any problems with old .pyc files hanging around if you move or rename files.

Not quite. In PEP-3147-land, you do not need to create the empty pycache directory, Python will create it for you on-demand. If you subsequently move the .py source file, the pycache/...pyc file will be ignored. So this is actually better than today because you can't accidentally load stale pyc files -- if they live inside pycache. For backward compatibility we'll still support loading lone pyc files in the source file directory (i.e. outside of pycache).

-Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-dev/attachments/20100324/70337bb7/attachment.pgp>



More information about the Python-Dev mailing list