Classic and New Style Classes?

Chris S. chrisks at NOSPAMudel.edu
Thu Jun 24 02:33:16 EDT 2004


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.



More information about the Python-list mailing list