Neil G Neil G - 1 year ago 77
Python Question

Determine a class's metaclass in Python 3

In Python 2, I could check a class's

attribute to determine its metaclass.

How do I the same thing in Python 3?

Answer Source

Use the single-argument type function (type(class)), or just access class.__class__. Both of these work in Python 2, btw.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download