Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 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?
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