Status of PEP's?

Jonathan Hogg jonathan at onegoodidea.com
Thu Mar 7 04:52:44 EST 2002


On 5/3/2002 4:46, in article 3C844D89.31AB890F at cosc.canterbury.ac.nz, "Greg
Ewing" <greg at cosc.canterbury.ac.nz> wrote:

> * Iterating over parallel lists can be written more
> symmetrically with it:
> 
> for i in indices(list1):
>   do_something_with(list1[i], list2[i])
> 
> looks better to me than
> 
> for i, item1 in indexed(list1):
>   do_something_with(item, list2[i])

Yes, but this only works with lists. The point of the 'indexed' proposal is
that it works with any iterable object.

An arbitrary iterable object may not have a length that is computable in
advance, may not be restartable, and quite likely isn't indexable.

Jonathan




More information about the Python-list mailing list