[issue7796] No way to find out if an object is an instance of a namedtuple

Antoine Pitrou report at bugs.python.org
Wed Jan 27 17:21:44 CET 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

> I need to be able to catch all named tuples, I don't know in advance
> what instance of a namedtuple it might be, but I want my function to
> only accept named tuples. Is this unreasonable?

I don't know. Why exactly don't you want to accept something else?
Perhaps the user has their own namedtuple-like class. Or perhaps they're
fine with plain tuples.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7796>
_______________________________________


More information about the Python-bugs-list mailing list