Message241586
> 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. |
|
Date |
User |
Action |
Args |
2015-04-20 01:43:08 | eric.snow | set | recipients:
+ eric.snow, rhettinger, terry.reedy, belopolsky, christian.heimes, ionelmc, steven.daprano, r.david.murray, Claudiu.Popa, ethan.furman, llllllllll, jedwards |
2015-04-20 01:43:08 | eric.snow | link | issue23990 messages |
2015-04-20 01:43:08 | eric.snow | create | |
|