Message98453
Hi Amaury,
Thanks. I had heard of but never bothered to read about duck-typing before now; though I have used it passively before. I think it does make sense in this case. I can't imagine any case where checking for the _fields attribute would fail and isinstance(x, namedtuple) would not.
Besides which, for my current project I am forced to implement such a "workaround" anyway, so it doesn't affect me as such.
The only reason that remains why I would want it is that I often use isinstance(x, Y) to deal with different Ys, and that was the thing I intuitively wanted to use in this case as a python programmer for quite a few years now. This is probably a pretty weak reason, so I am happy to close this issue if the consensus points to duck typing. |
|
| Date |
User |
Action |
Args |
| 2010-01-28 00:01:55 | pwaller | set | recipients:
+ pwaller, rhettinger, amaury.forgeotdarc, pitrou, thead, eric.araujo |
| 2010-01-28 00:01:55 | pwaller | set | messageid: <[email protected]> |
| 2010-01-28 00:01:53 | pwaller | link | issue7796 messages |
| 2010-01-28 00:01:52 | pwaller | create | |
|