Class types

Chris Lyon chris.lyon at tgm.co.uk
Tue Aug 20 11:13:50 EDT 2002


How do I find out what type of object an instance is?

I can use isinstance but I have to know the class I am expecting, and
if this involves sub-classes then I have long winded successions of
isinstance where the order is very important because sub-classes are
instances of their super class.
I ask because I am trying to return a list of different objects which
are all examples of sub classes of a particular class and I would like
to order them by the sub class they are from. I've used isinstance and
allocated a weighting which Is apprpriate but I feel I'm missing
something.



More information about the Python-list mailing list