Author rhettinger
Recipients Zero, docs@python, r.david.murray, rhettinger, terry.reedy, veky
Date 2017-07-17.14:30:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The wold "iterable" just means "can be looped over".  There are many ways to implement this capability (two-arg form of iter(), the __iter__ method, generators, __getitem__ with integer indexing, etc). is more limited and that is okay.  There is nothing that compels us to break an API has been around and successful for 26+ years.  That clearly wasn't Guido's intention when he added which is just a building block for more complex ABCs.

I recommend closing this.  We're not going to kill a useful API and break tons of code because of an overly pedantic reading of what is allowed to be iterable.

However we can make a minor amendment to the glossary entry to mention that there are multiple ways of becoming iterable.

Stephen, the try/except is a reasonable way to recognize an iterable.  The ABCs are intended to recognize only things that implement a particular implementation or that are registered.  It is not more encompassing or normative than that.
Date User Action Args
2017-07-17 14:30:24rhettingersetrecipients: + rhettinger, terry.reedy, r.david.murray, Zero, docs@python, veky
2017-07-17 14:30:24rhettingersetmessageid: <>
2017-07-17 14:30:24rhettingerlinkissue18558 messages
2017-07-17 14:30:24rhettingercreate