This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: python 3 docs' iterator example has python 2 code
Type: Stage: resolved
Components: Documentation Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, robotwizard, willingc
Priority: normal Keywords:

Created on 2018-02-18 16:27 by robotwizard, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg312312 - (view) Author: robotwizard (robotwizard) Date: 2018-02-18 16:27
Please note this is my first issue.

The documentation at https://docs.python.org/3/tutorial/classes.html#iterators on the second code block gives the example of iterating a string by creating an iterator out of it. However I tried it with python 3.5 and 3.6 and both give me a "str_iterator" which has no "next()" method. When I tried the code with python 2.7, it works.
msg312313 - (view) Author: robotwizard (robotwizard) Date: 2018-02-18 16:31
I'm so sorry... I tried doing it.next() instead of next(it). I'm sincerely sorry. I promise not to be so frivolous about opening an issue on the bug tracker next time.
History
Date User Action Args
2022-04-11 14:58:57adminsetgithub: 77049
2018-02-18 16:31:40robotwizardsetstatus: open -> closed
resolution: not a bug
messages: + msg312313

stage: resolved
2018-02-18 16:27:43robotwizardcreate