I am trying to acquire a basic understanding of python introspection and in doing so I found the in that regard useful mro() method mentioned here.
When I (as an introspection exercise) tried to use said method and the builtin dir() function in an attempt to find out where mro() might live, I however was unable to succeed. Why?
Here is my approach:
- the - mro()method obviously is available without any imports (unlike- inspect.getmro()which is part of the- inspectmodule; e.g.- str.mro()returns- [<class 'str'>, <class 'object'>]
- Since - str.mro()returns- [<class 'str'>, <class 'object'>], the- mro()method should live somewhere in- strand/or- object.
- Yet neither - dir(str)nor- dir(object)appear to contain the mro() method. Also help() and help(str.mro) do not enlighten the puzzled student of introspection.
 
    