Re: PEP 420: Implicit Namespace Packages

Barry Warsaw <[email protected]>
Newsgroups gmane.comp.python.import
Organization The Organization of Unorganized Woozalists
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.