[Python-Dev] Lockstep iteration - eureka!

Paul Prescod paul@prescod.net
Fri, 11 Aug 2000 08:19:05 -0500


Just van Rossum wrote:
> 
> ...
>
>        for <index> indexing <element> in <seq>:
>            ...

 
Let me throw out another idea. What if sequences just had .items()
methods?

j=range(0,10)

for index, element in j.items():
    ...

While we wait for the sequence "base class" we could provide helper
functions that makes the implementation of both eager and lazy versions
easier.

-- 
 Paul Prescod - Not encumbered by corporate consensus
"I don't want you to describe to me -- not ever -- what you were doing
to that poor boy to make him sound like that; but if you ever do it
again, please cover his mouth with your hand," Grandmother said.
	-- John Irving, "A Prayer for Owen Meany"