[docs] [issue18558] Iterable glossary entry needs clarification

R. David Murray report at bugs.python.org
Thu Aug 1 22:26:32 CEST 2013

R. David Murray added the comment:

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.


Python tracker <report at bugs.python.org>

More information about the docs mailing list