What is Inspect.getmro for? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is Inspect.getmro for?

I'm novice at programming, especially at python. I'm kinda having trouble with understanding the concept of inspect module and getmro function. When I call `help (inspect.getmro)` it says *Return tuple of base classes (including cls) in method resolution order.* What are base classes? And, what is cls?

17th Aug 2019, 8:02 PM
Baran Aldemir
Baran Aldemir - avatar
1 Answer
0
The base classes are the classes from which one class inherits. E.g class A() : pass class B(A) : pass #A is the base class of B, because B inherits from A cls is usually the name of this class. In the above example, cls refers to class B. https://code.sololearn.com/cBuY96v0j73K/?ref=app
27th Aug 2019, 6:52 AM
Théophile
Théophile - avatar