[Python-ideas] Changing the name of __pycache__

Paul Moore p.f.moore at gmail.com
Wed Feb 9 12:32:55 CET 2011


On 9 February 2011 10:41, Nick Coghlan <ncoghlan at gmail.com> wrote:
> 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).

Note that it looks like bdist_wininst installers don't delete the
__pycache__ entries on an uninstall (which I'd argue is an error, but
I'm not going to bother until I at least have time to raise an issue
for it...)

So satisfying imports from __pycache__ without there being a source
file would break bdist_wininst uninstallation badly as things stand.

Paul.



More information about the Python-ideas mailing list