Eric Snow added the comment: > Ionel Cristian Mărieș added the comment: > It's not. Did you see the example with iter()/__iter__? It does convert > the AttributeError into a TypeError.
callable and iter are not the same thing though. callable checks for a capability. iter invokes a capability. The direct comparision would be collections.abc.Iterable.__subclasshook__ (e.g. isinstance(obj, Iterable)), which behaves exactly like callable does (does not invoke the descriptor protocol). See Lib/_collections_abc.py. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23990> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com