"isinstance" question

Ben Finney ben+python at benfinney.id.au
Tue Jun 22 23:13:37 EDT 2010


John Nagle <nagle at animats.com> writes:

>   I want to test whether an object is an instance of any user-defined
> class.  "isinstance" is less helpful than one would expect.

Right. The type hierarchy is now unified; there's essentially no
difference in later Python versions between user-defined types and
built-in types.

> So that's useless.

For what purpose?

> I have to be missing something obvious here.

Maybe if we know what you're trying to do, we can suggest a better way.

-- 
 \            “Human reason is snatching everything to itself, leaving |
  `\                     nothing for faith.” —Saint Bernard, 1090–1153 |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list