[Import-SIG] PEP 420 issue: extend_path
Nick Coghlan
ncoghlan at gmail.com
Fri May 11 02:48:55 CEST 2012
On Fri, May 11, 2012 at 10:31 AM, Eric V. Smith <eric at trueblade.com> wrote:
> On 05/10/2012 08:09 PM, Nick Coghlan wrote:
>> How is starting an accumulator and returning it unconditionally *more*
>> complicated than "if you don't find any portions return None".
>
> There's no doubt in my mind that it would make zipimport more complex to
> use an accumulator.
Yeah, I sent my reply before I had fully processed your second
paragraph. For those either/or cases, I don't see much difference
between:
loader = portion = None
# Algorithm that may set either loader or portion
return loader, portion
And:
loader = None
portion = ()
# Algorithm that may set either loader or portion
return loader, portion
It's just a matter of using "()" for the portion component wherever
you would have otherwise written "None".
>> It makes no sense. We *have* to handle the empty iterator case
>> regardless. Allowing None *as well* is just plain redundant.
>
> Okay, I find that compelling.
It took me a while to figure out exactly what was bugging me about the
idea of allowing a None return, I think I finally got there with that
paragraph :)
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Import-SIG
mailing list