Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
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 up-
Andy McDonald
Python Development Techdegree Graduate 13,801 Points1 Answer
-
Nick Jahanshahi
1,499 Points1 Answer
-
J fori
Python Development Techdegree Student 200 Points1 Answer
-
Ahmody Mody
3,282 Points2 Answers
-
Safae Merigh
9,827 Points2 Answers
-
Shreya Tyagi
3,011 Points1 Answer
-
Kyle Harris
2,149 Points2 Answers
-
Nancy Nyabuti
5,298 Points1 Answer
-
Basel Kanaan
4,458 Points1 Answer
-
chinmayanand mishra
3,927 Points0 Answers
-
Kohei Ashida
4,882 PointsConsole is slightly different between the video and the workspace.
Posted by Kohei AshidaKohei Ashida
4,882 Points1 Answer
-
jaesonshin
Python Development Techdegree Graduate 9,939 Points1 Answer
-
brandon supinski
Python Development Techdegree Graduate 27,983 Points2 Answers
-
Matty Pallachi
1,616 Points1 Answer
-
Brian Davis
1,628 Points4 Answers
-
Son-Hai Nguyen
2,481 Points4 Answers
View all discussions for this video
Related 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