[Import-SIG] PEP 420: Implicit Namespace Packages

Barry Warsaw barry at python.org
Thu May 3 03:23:55 CEST 2012


On May 02, 2012, at 08:58 PM, Eric V. Smith wrote:

>On 5/2/2012 5:05 PM, PJ Eby wrote:
>
>>     I don't see the value of __file__ at all in the case of namespace
>>     packages. If it's just a hint that it's a namespace package, I think it
>>     would be better to set __file__ to None. That would noisily break some
>>     code that isn't likely to work anyway.
>> 
>> 
>> Either None or a missing attribute is fine with me.  (One advantage to
>> the missing attribute is that it fails at the exact point where the
>> inspecting code needs fixing, whereas the None will get passed on to
>> some other code before the error manifests itsefl.)
>
>I can go either way on this, but would lean toward __file__ not being
>set. Brett: what's your opinion?

I rather like __file__ not existing, although I haven't really thought about
the practical effects.  PJE makes a good argument though.

-Barry


More information about the Import-SIG mailing list