Re: PEP 420 outstanding issues

Brett Cannon <[email protected]>
Newsgroups gmane.comp.python.import
Message-ID <CAP1=2W4mo84nJ9TDSWPr_btSTX0UQbXQ1gbEpp8kvWtW27yzkw@mail.gmail.com>
On Fri, May 11, 2012 at 8:14 PM, Nick Coghlan <[email protected]> wrote:

> PJE's proposal that self-contained package loaders *also* report their
> prospective __path__ entries in the second half of the tuple sounds
> reasonable to me. It provides a way to cleanly distinguish all 4
> significant cases (standalone module, regular package, package portion, not
> found).
>
> The standard import system will treat the first two cases the same way,
> but making the distinction official means custom import systems can decide
> to do something different.
>

If we are going as far as to have finders return the value of __path__,
should we add an equivalent extension to the loader API to get the sequence
back? I have always found it extremely regrettable that is_package() was
defined to return a boolean instead of the list for __path__. Otherwise I
would at least want to change the __init__ signature for the various
loaders that FileFinder uses to take this new path argument so it doesn't
need to be recalculated and then expose it somehow as an attribute
(although right now FileLoader already sets a 'path' attribute; might need
to rename that filepath/file_path).

_______________________________________________
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.