[issue7796] No way to find out if an object is an instance of a namedtuple
Amaury Forgeot d'Arc
report at bugs.python.org
Wed Jan 27 17:36:49 CET 2010
Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:
It seems a perfect case for "duck typing" style of programming:
All namedtuple classes:
- inherit from tuple
- have a "_fields" class attribute
These two properties could be the "duck test" for namedtuples, regardless of the actual implementation.
----------
nosy: +amaury.forgeotdarc
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7796>
_______________________________________
More information about the Python-bugs-list
mailing list