Re: PEP 420: Implicit Namespace Packages

Brett Cannon <[email protected]>
Newsgroups gmane.comp.python.import
Message-ID <CAP1=2W6AH_OdcVsNizK3rzZYNkWp4K7Ccfu35VwLYKAEAH8JZA@mail.gmail.com>
On Thu, May 3, 2012 at 12:11 PM, PJ Eby <[email protected]> wrote:

> On Thu, May 3, 2012 at 2:23 AM, Nick Coghlan <[email protected]> wrote:
>
>> Standardising on a pattern also opens up the possibility of doing
>> something meaningful with it in get_data() later. One of the
>> guarantees of PEP 302 if that you should be able to do this:
>>
>>  data_ref = os.path.join(__file__, relative_ref)
>>  data =  __loader__.get_data(data_ref)
>>
>
> Um, namespace package modules shouldn't have a __loader__ either, should
> they?
>

No, they should (and PEP 302 now requires that). Namespace modules are
loaded by a loader, and thus should have it defined. It's all the other
optional interfaces that they don't need to have (e.g. NamespaceLoader
should have importlib.abc.Loader and probably none of the other ABCs).


>
>
> _______________________________________________
> Import-SIG mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/import-sig
>
>

_______________________________________________
Import-SIG mailing list
[email protected]
http://mail.python.org/mailman/listinfo/import-sig
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.