classification
Title: iter.next() or iter.__next__() ?
Type: behavior Stage:
Components: Documentation Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: benjamin.peterson, georg.brandl, vizcayno
Priority: normal Keywords:

Created on 2008-07-03 15:09 by vizcayno, last changed 2008-07-03 20:29 by benjamin.peterson. This issue is now closed.

Messages (4)
msg69205 - (view) Author: vizcayno (vizcayno) Date: 2008-07-03 15:09
For Win XP SP3 I do next in py30.b1:

a=[9,8,1,2]
it=iter(a)
it.next()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'list_iterator' object has no attribute 'next'

but doing:
it.__next__()
9
it.__next__()
8

it is ok.

However, manual of Py3.0 indicates iter.next() as valid.

Python 25 does not accept "it.__next__()" but "it.next()"
Regards.
msg69226 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-07-03 18:59
Where in the 3.0 docs do you see it.next() used? It should be changed.
msg69228 - (view) Author: vizcayno (vizcayno) Date: 2008-07-03 20:05
Please, go to python 3.0 -> python manuals and search with word: iter
then select first line of found titles, i.e. Functional Programming 
HOWTO. Into this title you will find some samples.
Regards,
msg69229 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-07-03 20:29
fixed in r64696.
History
Date User Action Args
2008-07-03 20:29:29benjamin.petersonsetstatus: open -> closed
resolution: fixed
2008-07-03 20:29:01benjamin.petersonsetmessages: + msg69229
2008-07-03 20:05:32vizcaynosetmessages: + msg69228
2008-07-03 18:59:30benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg69226
2008-07-03 15:10:00vizcaynocreate