Message241586
| Author |
eric.snow |
| Recipients |
Claudiu.Popa, belopolsky, christian.heimes, eric.snow, ethan.furman, ionelmc, jedwards, llllllllll, r.david.murray, rhettinger, steven.daprano, terry.reedy |
| Date |
2015年04月20日.01:43:08 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<CALFfu7AL+9MSeMN156PcgVuoMDzCNphQ0e-0-TWKLm4mQHzvAQ@mail.gmail.com> |
| In-reply-to |
<CANkHFr-Aq4DUf6ViVfHhYYEH25opGNgQz0hriMf2xYmvKWwLbQ@mail.gmail.com> |
| Content |
> 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. |
|
History
|
|---|
| 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 |
|