Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
We're not limited to a single parent class in Python. Let's see how to use this feature to make our code even more clean and clear.
You can use class.__mro__
to look at your class's method resolution order (MRO) if you're curious. Or use the inspect.getmro()
function with your class to get the same information. This can be really handy if you're not sure what order the classes are being assembled.
When you're using multiple inheritance, super()
calls become really important. They let things like __init__
travel all the way up the chain to make sure the class has all of the bits and pieces that it needs.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up