[Python-3000] PEP 3132: Extended Iterable Unpacking

Greg Ewing greg.ewing at canterbury.ac.nz
Fri May 4 06:13:21 CEST 2007


Simon Percivall wrote:
> if the proposal is constrained to only allowing the *name at
> the end, wouldn't a more useful behavior be to not exhaust the
> iterator, making it similar to:
> 
>  > it = iter(range(10))
>  > a = next(it)
>  > b = it
> 
> or would this be too surprising?

It would surprise the heck out of me when I started
with something that wasn't an iterator and ended
up with b being something that I could only iterate
and couldn't index.

--
Greg


More information about the Python-3000 mailing list