What happened to types.ClassType in python 3? What happened to types.ClassType in python 3? python-3.x python-3.x

What happened to types.ClassType in python 3?


I figured it out. It seems that classes are of type "type". Here is an example of how to distinguish between classes and other objects at runtime.

>>> class C: pass... >>> type(C)<class 'type'>>>> isinstance(C, type)True>>> isinstance('string', type)False


It was used for classic classes. In Python 3 they're gone.I suppose you could use something like:

issubclass(ClassName, object)