[Python-Dev] inspect and metaclasses

Ethan Furman ethan at stoneleaf.us
Fri Sep 6 15:32:46 CEST 2013

Part of the fix for issue #18693  is to fix inspect to look in the metaclass for class attributes 

In inspect.py in function get_mro() we can either add the metaclass unconditionally, or only if it is not 'type'.

If we add unconditionally, then help() adds the following:

       class A(builtins.object)
        |  Hello and goodbye
+      |
+      |  Method resolution order:
+      |      A
+      |      builtins.object
+      |      builtins.type
        |  Methods defined here:

Do we want that, or should we just add the metaclass if it is not 'type'?


More information about the Python-Dev mailing list