[Python-ideas] Changing the name of __pycache__

Nick Coghlan ncoghlan at gmail.com
Wed Feb 9 11:41:59 CET 2011

Raymond's suggestion is specifically addressed (and rejected) in PEP
3147: http://www.python.org/dev/peps/pep-3147/#pyc

On Wed, Feb 9, 2011 at 7:07 PM, M.-A. Lemburg <mal at egenix.com> wrote:
> I'm not sure why this was done. It looks like an unnecessary
> limitation of the PEP.

Because we wanted deleting the .py file to be the "one obvious way" to
remove a module, rather than allowing "ghost modules" to hang around
in __pycache__. Sourceless imports use the legacy .pyc location to
distinguish them as a deliberate distribution choice over the "mere"
caching in __pycache__. (Note that the original version of PEP 3147
didn't support sourceless distribution at all).


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list