|
| https://realpython.com/ |
| Start Here | https://realpython.com/start-here/ |
|
Learn Python
| https://realpython.com/lessons/python-class-inheritance-summary/ |
| Python Tutorials →In-depth articles and video courses | https://realpython.com/search?kind=article&kind=course&order=newest |
| Learning Paths →Guided study plans for accelerated learning | https://realpython.com/learning-paths/ |
| Quizzes & Exercises →Check your learning progress | https://realpython.com/quizzes/ |
| Browse Topics →Focus on a specific area or skill level | https://realpython.com/tutorials/all/ |
| Community Chat →Learn with other Pythonistas | https://realpython.com/community/ |
| Office Hours →Live Q&A calls with Python experts | https://realpython.com/office-hours/ |
| Podcast →Hear what’s new in the world of Python | https://realpython.com/podcasts/rpp/ |
| Books →Round out your knowledge and learn offline | https://realpython.com/products/books/ |
| Reference →Concise definitions for common Python terms | https://realpython.com/ref/ |
| Code Mentor →BetaPersonalized code assistance & learning tools | https://realpython.com/mentor/ |
| Unlock All Content → | https://realpython.com/account/join/ |
|
More
| https://realpython.com/lessons/python-class-inheritance-summary/ |
| Learner Stories | https://realpython.com/learner-stories/ |
| Python Newsletter | https://realpython.com/newsletter/ |
| Python Job Board | https://www.pythonjobshq.com |
| Meet the Team | https://realpython.com/team/ |
| Become a Tutorial Writer | https://realpython.com/write-for-us/ |
| Become a Video Instructor | https://realpython.com/become-an-instructor/ |
| Search | https://realpython.com/search |
| https://realpython.com/search |
| Join | https://realpython.com/account/join/ |
| Sign‑In | https://realpython.com/account/login/?next=%2Flessons%2Fpython-class-inheritance-summary%2F |
| Unlock This Lesson | https://realpython.com/account/join/?utm_source=rp_lesson&utm_content=python-class-inheritance |
| Unlock This Lesson | https://realpython.com/account/join/?utm_source=rp_lesson&utm_content=python-class-inheritance |
| https://realpython.com/courses/python-class-inheritance/#team |
| Inheritance and Internals: Object-Oriented Programming in Python | https://realpython.com/courses/python-class-inheritance/ |
| Christopher Trudeau | https://realpython.com/courses/python-class-inheritance/#team |
| Recommended Tutorial | https://realpython.com/python-classes/ |
| Course Slides (.pdf) | https://realpython.com/courses/python-class-inheritance/downloads/python-class-inheritance-slides/ |
| Sample Code (.zip) | https://realpython.com/courses/python-class-inheritance/downloads/python-class-inheritance-code/ |
| Ask a Question | https://realpython.com/lessons/python-class-inheritance-summary/#discussion |
| https://realpython.com/feedback/survey/course/python-class-inheritance/liked/?from=lesson-title |
| https://realpython.com/feedback/survey/course/python-class-inheritance/disliked/?from=lesson-title |
| Contents | https://realpython.com/lessons/python-class-inheritance-summary/#description |
| Transcript | https://realpython.com/lessons/python-class-inheritance-summary/#transcript |
| Discussion (4) | https://realpython.com/lessons/python-class-inheritance-summary/#discussion |
| Intro to Object-Oriented Programming (OOP) in Python | https://realpython.com/courses/intro-object-oriented-programming-oop-python/ |
| Inheritance and Composition: A Python OOP Guide | https://realpython.com/courses/inheritance-composition-python/ |
| Supercharge Your Classes With Python super() | https://realpython.com/courses/python-super/ |
| Managing Attributes With Python’s property() | https://realpython.com/courses/property-python/ |
| Using Data Classes in Python | https://realpython.com/courses/python-data-classes/ |
| Unlock This Lesson | https://realpython.com/account/join/?utm_source=rp_lesson_preview&utm_content=python-class-inheritance |
| Sign-In | https://realpython.com/account/login/ |
| Unlock This Lesson | https://realpython.com/account/join/?utm_source=rp_lesson_preview&utm_content=python-class-inheritance |
| Sign-In | https://realpython.com/account/login/ |
| 00:00 | https://realpython.com/lessons/python-class-inheritance-summary/#t=0.65 |
| In the previous lesson, I showed you abstract base classes and a duck typing | https://realpython.com/lessons/python-class-inheritance-summary/#t=0.65 |
| approach to the sequence protocol. | https://realpython.com/lessons/python-class-inheritance-summary/#t=5.35 |
| This lesson summarizes part two of the course. | https://realpython.com/lessons/python-class-inheritance-summary/#t=7.7 |
| 00:11 | https://realpython.com/lessons/python-class-inheritance-summary/#t=11.91 |
| You can build hierarchies of classes to better represent your real-world | https://realpython.com/lessons/python-class-inheritance-summary/#t=11.91 |
| structures and to reuse your code. This is known as inheritance. | https://realpython.com/lessons/python-class-inheritance-summary/#t=15.69 |
| A child class that extends a parent inherits its aspects. | https://realpython.com/lessons/python-class-inheritance-summary/#t=21.25 |
| 00:25 | https://realpython.com/lessons/python-class-inheritance-summary/#t=25.81 |
| A child isn’t stuck with those aspects. They can override them. | https://realpython.com/lessons/python-class-inheritance-summary/#t=25.81 |
| If a child does override the parent, | https://realpython.com/lessons/python-class-inheritance-summary/#t=30.56 |
| it can use super() to get at the parent’s methods, | https://realpython.com/lessons/python-class-inheritance-summary/#t=32.88 |
| meaning they don’t have to rewrite them. | https://realpython.com/lessons/python-class-inheritance-summary/#t=35.29 |
| 00:38 | https://realpython.com/lessons/python-class-inheritance-summary/#t=38.39 |
| Class hierarchies can have as many levels as you like, | https://realpython.com/lessons/python-class-inheritance-summary/#t=38.39 |
| and in fact, a class can also inherit from multiple parents. | https://realpython.com/lessons/python-class-inheritance-summary/#t=42.16 |
| If you want to partially define a class to spec out an interface, | https://realpython.com/lessons/python-class-inheritance-summary/#t=46.92 |
| the ABC module provides tools for doing that. | https://realpython.com/lessons/python-class-inheritance-summary/#t=50.44 |
| 00:55 | https://realpython.com/lessons/python-class-inheritance-summary/#t=55.66 |
| Everything in Python is an object (ka-ching!) | https://realpython.com/lessons/python-class-inheritance-summary/#t=55.66 |
| and when you do things to that object, like adding, | https://realpython.com/lessons/python-class-inheritance-summary/#t=59.75 |
| it’s done by invoking a dunder method. For example, | https://realpython.com/lessons/python-class-inheritance-summary/#t=62.68 |
| the descriptor protocol uses dunder methods to make methods behave like | https://realpython.com/lessons/python-class-inheritance-summary/#t=67.11 |
| attributes, | https://realpython.com/lessons/python-class-inheritance-summary/#t=71.13 |
| and the sequence protocol uses dunder methods to make things list-like. The | https://realpython.com/lessons/python-class-inheritance-summary/#t=72.07 |
| standard library takes full advantage of the class mechanisms in the language, | https://realpython.com/lessons/python-class-inheritance-summary/#t=77.01 |
| implementing the data class shortcut to make it faster to write attributes | https://realpython.com/lessons/python-class-inheritance-summary/#t=81.29 |
| and the Enum class to represent groups of constants. | https://realpython.com/lessons/python-class-inheritance-summary/#t=86.11 |
| 01:30 | https://realpython.com/lessons/python-class-inheritance-summary/#t=90.94 |
| This is part two of a three-part course. | https://realpython.com/lessons/python-class-inheritance-summary/#t=90.94 |
| Parts one and two were about the how—the syntax of classes in Python— | https://realpython.com/lessons/python-class-inheritance-summary/#t=93.56 |
| but just because you can doesn’t necessarily mean you should. | https://realpython.com/lessons/python-class-inheritance-summary/#t=99.33 |
| 01:43 | https://realpython.com/lessons/python-class-inheritance-summary/#t=103.7 |
| Part three of the course is a bit more philosophical. | https://realpython.com/lessons/python-class-inheritance-summary/#t=103.7 |
| It talks about how to write better object-oriented code and maybe when you | https://realpython.com/lessons/python-class-inheritance-summary/#t=107.25 |
| shouldn’t. Don’t worry, it isn’t highfalutin philosophy. | https://realpython.com/lessons/python-class-inheritance-summary/#t=111.11 |
| 01:54 | https://realpython.com/lessons/python-class-inheritance-summary/#t=114.72 |
| There are code examples to show you each of the principles covered. | https://realpython.com/lessons/python-class-inheritance-summary/#t=114.72 |
| A good part of the course is based on SOLID. | https://realpython.com/lessons/python-class-inheritance-summary/#t=119.11 |
| That’s an acronym to keep in mind that helps you write better object-oriented | https://realpython.com/lessons/python-class-inheritance-summary/#t=121.73 |
| code. What’s it stand for? Take part three to find out. | https://realpython.com/lessons/python-class-inheritance-summary/#t=125.34 |
| 02:09 | https://realpython.com/lessons/python-class-inheritance-summary/#t=129.73 |
| Or just Google SOLID and object-oriented and spoil the whole thing for yourself. | https://realpython.com/lessons/python-class-inheritance-summary/#t=129.73 |
| 02:16 | https://realpython.com/lessons/python-class-inheritance-summary/#t=136.08 |
| Well, thanks for sticking with me so far. On to part three. | https://realpython.com/lessons/python-class-inheritance-summary/#t=136.08 |
| Sept. 13, 2023 | https://realpython.com/lessons/python-class-inheritance-summary/#comment-a5432d11-daa1-446e-9c19-7e1eb98c237c |
| Sept. 14, 2023 | https://realpython.com/lessons/python-class-inheritance-summary/#comment-5885bf20-1d85-4117-b483-2c10df91c020 |
| Oct. 2, 2023 | https://realpython.com/lessons/python-class-inheritance-summary/#comment-6c0f14b9-914e-489d-a34d-b90d1d9ffe18 |
| Feb. 23, 2024 | https://realpython.com/lessons/python-class-inheritance-summary/#comment-c8612656-c314-4dcc-840d-976f4f0f2f9c |
| Become a Member | https://realpython.com/account/join/ |
| https://realpython.com/lessons/python-class-abstracts-and-interfaces/ |
| Overview | https://realpython.com/courses/python-class-inheritance/ |
|
Inheritance and Internals: OOP in Python (Overview) 03:38
| https://realpython.com/videos/python-class-inheritance-overview/ |
|
Inheritance Inside Python 09:07
| https://realpython.com/videos/inheritance-in-python/ |
|
Multiple Inheritance - Multiple Parents 09:30
| https://realpython.com/lessons/python-multiple-inheritance/ |
|
Class Internals 08:58
| https://realpython.com/lessons/python-class-internals/ |
|
More Special Methods 06:50
| https://realpython.com/lessons/python-class-special-methods/ |
|
Classes in the Standard Library 07:23
| https://realpython.com/lessons/python-class-standard-library/ |
|
Abstracts and Interfaces 08:41
| https://realpython.com/lessons/python-class-abstracts-and-interfaces/ |
|
Inheritance and Internals: OOP in Python (Summary) 02:21
| https://realpython.com/lessons/python-class-inheritance-summary/ |
| Privacy Policy | https://realpython.com/privacy-policy/ |
Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover