On Erik Johnson wrote: > # The following "works", but I don't want to keep a set of instances to > compare against > >>> obj2 = A() > >>> type(obj) == type(obj2) > 1
How about: >>> class A: pass >>> class B: pass >>> objA = A() >>> type( objA ) == type( A() ) True then again.... >>> objB = B() >>> type( objA ) == type( B() ) True they're both of type 'instance'. So how about this: >>> class A: pass >>> class B( object ): pass >>> objA = A() >>> objB = B() >>> type( objA ) <type 'instance'> >>> type( objB ) <class '__main__.B'> >>> type( objB ) == B True I believe that achieves what you were aiming for. -- Daniel Bickett dbickett at gmail.com http://heureusement.org/ -- http://mail.python.org/mailman/listinfo/python-list