[Python-Dev] __file__

Michael Foord fuzzyman at voidspace.org.uk
Fri Feb 26 00:50:45 CET 2010

On 25/02/2010 23:56, Greg Ewing wrote:
> Barry Warsaw wrote:
>> We discussed this at Pycon and agreed that we will not support 
>> source-less
>> deployments by default. The source file must exist or it will be an
>> ImportError.
>> This does not mean source-less deployments are not possible though. To
>> support this use case, you'd have to write a custom import hook.
> What????
> I don't like this idea at all. I object to being forced to
> jump through an obscure hoop to do something that's been
> totally straightforward until now.
I thought we agreed at the language summit that if a .pyc was in the 
place of the source file it *could* be imported from - making pyc only 
distributions possible. As the pyc files are in the __pycache__ (or 
whatever) directory by default they *won't* be importable without the 
source files. A pyc only distribution can easily be created though with 
this scheme.



READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.

More information about the Python-Dev mailing list