[Import-SIG] PEP 420 issue: extend_path

Eric V. Smith eric at trueblade.com
Tue May 8 20:08:39 CEST 2012

On 5/8/2012 12:09 PM, PJ Eby wrote:
> On Tue, May 8, 2012 at 10:07 AM, Eric V. Smith <eric at trueblade.com
> <mailto:eric at trueblade.com>> wrote:
>     I don't disagree with this. But we've got a function that we're asking
>     to return one of 2 things, as you say. How is this normally handled? I
>     would not use a callback. I'd return a tuple with the two things:
>     (loader, list_of_portions). That seems way more straightforward.
> +1.  It's also easy to implement.
> I'm not sure why we *need* a list of portions, but if we do, simple
> return values seem like the way to go.  But the 2-element tuple wins
> even in the single path portion case, and the tuple-return protoocol is
> extensible if we need more data returned in future anyway.

Nick laid out a use case in a previous email. It makes sense to me. For
example, a zip file could contain multiple portions from the same
namespace package. You'd need a new path hook or mods to zipimport, but
it's conceivable.


More information about the Import-SIG mailing list