On this page
inspect.getmro
Prev: inspect.getmodulename | Up: inspect | Next: inspect.getouterframes
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org — inspect.getmro
Tags: #public #python3 #stdlib #inspect
Import
import inspect
from inspect import getmro
Signature & Overview
inspect.getmro(cls)
Return tuple of base classes (including cls) in method resolution order.
Usage
import inspect
class A: pass
class B(A): pass
assert inspect.getmro(B) == (B, A, object)
Gotchas
- Same as
cls.__mro__: Returns the C3 linearization tuple of base classes.
REPL Inspect
from inspect import getmro
help(getmro)
Linked from
Related notes
- tuts/python3/stdlib_module/inspect/getmodulename Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/getouterframes Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/inspect/ArgInfo Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/Arguments Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/Attribute Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BlockFinder Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BoundArguments shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BufferFlags shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/ClassFoundException shared tags: #inspect, #stdlib