Re: PEP 420: Implicit Namespace Packages

[email protected]
Newsgroups gmane.comp.python.import
Message-ID <[email protected]>
Zitat von Barry Warsaw <[email protected]>:

> On May 03, 2012, at 10:48 AM, Brett Cannon wrote:
>
>> So, to the people not wanting to set __file__, that  (probably) won't fly
>> because it has been documented for years that built-in modules are the only
>> things that don't define __file__.
>
> Okay, but *why* is this the rule, other than that PEP 302 says it?

I think it predates PEP 302 by a decade or so. You might also ask why
the keyword is "def", and not "define" (other than that the Grammar says
so). It's a natural thing, also: If the module comes from the file system,
it has an __file__ attribute, else it's built-in.

Regards,
Martin
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.