[Python-Dev] PEP 420 - dynamic path computation is missing rationale (original) (raw)

Nick Coghlan ncoghlan at gmail.com
Wed May 23 06:27:18 CEST 2012


On Wed, May 23, 2012 at 1:58 PM, PJ Eby <pje at telecommunity.com> wrote:

While I see no problem with cleaning up the interface, I'm kind of lost as to the point of making a getpath callable, vs. just using the iterable interface you sketched.  Python has iterables, so why add a call to get the iterable, when iter() or a straight "for" loop will do effectively the same thing?

Yeah, I'm not sure what I was thinking either, since just documenting the interface and providing LazyPath as a public API somewhere in importlib should suffice. Meta path hooks are already going to need to tolerate being handed arbitrary iterables, since that's exactly what namespace package path objects are going to be.

While I still like the idea of killing off find_module() completely rather than leaving it in at the meta_path level, there's no reason that needs to be done as part of PEP 420 itself. Instead, it can be done later if anyone comes up with a concrete use case for access the path details without loading packages and modules.

Cheers, Nick.

-- Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-Dev mailing list