Re: PEP 420 issue: extend_path

Nick Coghlan <[email protected]>
Newsgroups gmane.comp.python.import
Message-ID <CADiSq7eNmKhhgfK-YrNm=vBD10CKGcJMMBVTbf_09jMBo5_trQ@mail.gmail.com>
On Wed, May 9, 2012 at 10:16 AM, Eric V. Smith <[email protected]> wrote:
> In the pep-420 branch I've checked in code where find_loader() returns
> (loader, list_of_portions). I've implemented it for the FileFinder and
> zipimport.
>
> loader can be None or a loader object.
> list_of_portions can be an empty list, or a list of strings.
>
> To indicate "no loader or portions found", return (None, []).
>
> If loader is not None, list_of_portions is ignored.
>
> I'm pretty happy with this API. Comments welcome.

Yeah, I think that works well and covers all the even vaguely
reasonable cases. Besides, any desire for truly exotic import
behaviour can always be handled via sys.meta_path.

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
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.