array next pointer

R. David Murray rdmurray at bitdance.com
Tue Mar 17 15:17:02 EDT 2009


Benjamin Peterson <benjamin at python.org> wrote:
> Luis Zarrabeitia <kyrie <at> uh.cu> schrieb:
> > 
> > Works for python2.4 and 2.5 also.
> > 
> > In python3, this should be used instead:
> > 
> > >>> b = iter(a)
> > >>> c = next(b)
> > 
> > (btw, I love the new sentinel argument for the next function in python3!)
> 
> next() doesn't have a sentinel argument. It's iter() which does, and that's in
> 2.x also.

But it does have a 'default' argument, and you can pass that
a sentinel, so it amounts to the same thing ;)

--
R. David Murray           http://www.bitdance.com




More information about the Python-list mailing list