Python 2: someIterator.next() vs. next(someIterator) :Python 3

Viewed 2692

In Python 2 iterators offer .next(), a callable method:

it = iter(xrange(10))
it.next()
> 0
it.next()
> 1
...

In Python 3 one has to use the built-in function next():

it = iter(range(10))
next(it)
> 0
next(it)
> 1
...

Is this just "syntactic sugar"? Like making it more obvious to use next() by moving it into the built-in functions? Or does any advanced concept hide behind this change?

1 Answers
Related