[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

2017-07-13 Thread R. David Murray
R. David Murray added the comment: I just had a colleague get confused about the container returning self, and he was referring to the iterator protocol docs at https://docs.python.org/3.6/library/stdtypes.html#iterator.__iter__. If you don't read that section with your thinking cap firmly in

[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

2016-10-17 Thread loic rowe
loic rowe added the comment: A new proposal is to add at the end of the paragraph on the iterator those point: """ As you should have noticed this Reverse let you iterate over the data only once:: >>> rev = Reverse('spam') >>> for char in rev: ... print(char) ... m a p

[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

2016-10-14 Thread loic rowe
loic rowe added the comment: I don't disapprove the proposal on the need to have an explanation on the difference between a container and an iterator. But I was unable to found in the documentation a proper definition of a container. -- ___ Python

[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

2016-10-14 Thread Anders Kaseorg
Anders Kaseorg added the comment: Usui, this is a tutorial intended for beginners. Even if the change from “most” to “built-in” were a relevant one (and I don’t see how it is), beginners cannot possibly be expected to parse that level of meaning out of a single word. The difference between it

[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

2016-10-14 Thread Usui
Usui added the comment: My proposal for this documentation point is to get rid off the word "most" and to replace it with "built-in". Since it will remove the misleading idea that this paragraph can explain how you can write a containers. -- keywords: +patch nosy: +Usui Added file: htt

[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

2016-10-13 Thread Stéphane Wirtel
Changes by Stéphane Wirtel : -- versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.2, Python 3.3 ___ Python tracker ___ ___ Python

[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

2012-05-16 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +terry.reedy versions: +Python 3.3 -Python 2.6, Python 3.1 ___ Python tracker ___ ___ Python-bugs-