C
Chris S.
I'm generating the source of an object from a list of objects. Therefore
I need to determine if the object is a class definition (i.e. 'def
something(whatever):') or a class instance (i.e. 'somename =
somethingelse()'). With classic classes this is trivial, since all I
have to do is check the type. However, for the new "improved" style
classes this seems next to impossible, since everything is essentially
an instance of something.
isinstance(class, classinfo) won't work since I won't necessarily know
classinfo.
Is there any way to make this distinction? Any help is appreciated.
I need to determine if the object is a class definition (i.e. 'def
something(whatever):') or a class instance (i.e. 'somename =
somethingelse()'). With classic classes this is trivial, since all I
have to do is check the type. However, for the new "improved" style
classes this seems next to impossible, since everything is essentially
an instance of something.
isinstance(class, classinfo) won't work since I won't necessarily know
classinfo.
Is there any way to make this distinction? Any help is appreciated.