Iterating over multiple lists (a newbie question)

Tim Peters tim.one at home.com
Sun Jan 7 05:09:35 EST 2001


[Moshe Zadka]
> So why can't map just assume things without length have length 0?

Obviously, it could, since it tolerates lies already.

> ...
> From my reading of the source, you'd have to change the
>
>                 if ((curlen = sqp->len =
> (*sqp->sqf->sq_length)(sqp->seq)) < 0)
>                         goto Fail_2;
>
> Into a special case for instances which first checks to see
> whether __len__ exists, and take the sqf->sq_length check out
> of the if.
>
> Is there something bad about doing this, or has it just been
> lack of time?

I'd say it's more lack of interest -- of all the interesting things one
*might* do in the Python universe, adding more hacks to map() is scraping
the bottom of the snake's belly.

number-of-requests-zero-number-of-volunteers-zero-ly y'rs  - tim





More information about the Python-list mailing list