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.

Author r.david.murray
Recipients Zero, docs@python, r.david.murray, terry.reedy
Date 2013-08-01.20:26:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375388792.26.0.533463547564.issue18558@psf.upfronthosting.co.za>
In-reply-to
Content
That would give you a false positive, though.  It would return True for the 'y' in my example, which is not iterable.  So Iterable's behavior here is an example of the Python design rule "resist the temptation to guess".

As Terry said, new classes should implement an __iter__ method.  The __getitem__ iteration support is for backward compatibility.
History
Date User Action Args
2013-08-01 20:26:32r.david.murraysetrecipients: + r.david.murray, terry.reedy, Zero, docs@python
2013-08-01 20:26:32r.david.murraysetmessageid: <1375388792.26.0.533463547564.issue18558@psf.upfronthosting.co.za>
2013-08-01 20:26:32r.david.murraylinkissue18558 messages
2013-08-01 20:26:32r.david.murraycreate