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 <rep...@bugs.python.org> <http://bugs.python.org/issue18558> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com