|
| https://realpython.com/ |
| Start Here | https://realpython.com/start-here/ |
|
Learn Python
| https://realpython.com/courses/solid-principles-python/continue/ |
| 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/courses/solid-principles-python/continue/ |
| 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=%2Fvideos%2Fsolid-principles-python-overview%2F |
| https://realpython.com/courses/solid-principles-python/#team |
| Design and Guidance: Object-Oriented Programming in Python | https://realpython.com/courses/solid-principles-python/ |
| Christopher Trudeau | https://realpython.com/courses/solid-principles-python/#team |
| Recommended Tutorial | https://realpython.com/solid-principles-python/ |
| Course Slides (.pdf) | https://realpython.com/courses/solid-principles-python/downloads/solid-principles-python-slides/ |
| Sample Code (.zip) | https://realpython.com/courses/solid-principles-python/downloads/solid-principles-python-code/ |
| Ask a Question | https://realpython.com/courses/solid-principles-python/continue/#discussion |
| https://realpython.com/feedback/survey/course/solid-principles-python/liked/?from=lesson-title |
| https://realpython.com/feedback/survey/course/solid-principles-python/disliked/?from=lesson-title |
| Contents | https://realpython.com/courses/solid-principles-python/continue/#description |
| Transcript | https://realpython.com/courses/solid-principles-python/continue/#transcript |
| Discussion | https://realpython.com/courses/solid-principles-python/continue/#discussion |
| Part one | https://realpython.com/courses/python-class-object/ |
| Part two | https://realpython.com/courses/python-class-inheritance/ |
| Sample Code (.zip) | https://realpython.com/courses/solid-principles-python/downloads/solid-principles-python-code/ |
| Course Slides (.pdf) | https://realpython.com/courses/solid-principles-python/downloads/solid-principles-python-slides/ |
| 00:00 | https://realpython.com/courses/solid-principles-python/continue/#t=0.53 |
| Welcome to Object-Oriented Coding in Python: Design and Guidance. | https://realpython.com/courses/solid-principles-python/continue/#t=0.53 |
| My name is Christopher, and I will be your guide. | https://realpython.com/courses/solid-principles-python/continue/#t=4.75 |
| 00:08 | https://realpython.com/courses/solid-principles-python/continue/#t=8.73 |
| This is the third part of a multi-part course. | https://realpython.com/courses/solid-principles-python/continue/#t=8.73 |
| Parts one and two are about the how of object-oriented coding, covering the | https://realpython.com/courses/solid-principles-python/continue/#t=11.99 |
| syntax of classes in Python and how to use its attributes and methods. | https://realpython.com/courses/solid-principles-python/continue/#t=16.54 |
| 00:21 | https://realpython.com/courses/solid-principles-python/continue/#t=21.68 |
| As everything in Python is an object, that includes intricate details, | https://realpython.com/courses/solid-principles-python/continue/#t=21.68 |
| such as how operations like adding and multiplying apply to your objects through | https://realpython.com/courses/solid-principles-python/continue/#t=25.57 |
| dunder methods. This third part of the course is a little different. | https://realpython.com/courses/solid-principles-python/continue/#t=30.14 |
| 00:34 | https://realpython.com/courses/solid-principles-python/continue/#t=34.83 |
| It’s a bit more about the why and approach. | https://realpython.com/courses/solid-principles-python/continue/#t=34.83 |
| The focus in this part of the course is about how to build better | https://realpython.com/courses/solid-principles-python/continue/#t=37.98 |
| object-oriented software and, in some cases, why you maybe shouldn’t use OO | https://realpython.com/courses/solid-principles-python/continue/#t=41.44 |
| techniques at all. | https://realpython.com/courses/solid-principles-python/continue/#t=46.37 |
| 00:49 | https://realpython.com/courses/solid-principles-python/continue/#t=49.18 |
| This third part of a three-part course teaches you about how the | https://realpython.com/courses/solid-principles-python/continue/#t=49.18 |
| Python object-oriented approach compares to other languages, when not | https://realpython.com/courses/solid-principles-python/continue/#t=53.95 |
| to use classes in Python, alternatives to inheritance, and | https://realpython.com/courses/solid-principles-python/continue/#t=58.79 |
| the SOLID principles. | https://realpython.com/courses/solid-principles-python/continue/#t=64.01 |
| 01:07 | https://realpython.com/courses/solid-principles-python/continue/#t=67.37 |
| The code in this course was written with Python 3.11. Object-oriented coding | https://realpython.com/courses/solid-principles-python/continue/#t=67.37 |
| in Python has gone through some changes over the years, | https://realpython.com/courses/solid-principles-python/continue/#t=71.93 |
| and so the code presented here won’t work in Python 2 without being altered. | https://realpython.com/courses/solid-principles-python/continue/#t=74.17 |
| 01:20 | https://realpython.com/courses/solid-principles-python/continue/#t=80.4 |
| Python’s a bit of a weird beast language-wise. | https://realpython.com/courses/solid-principles-python/continue/#t=80.4 |
| Its history is firmly in the procedural style scripting world, | https://realpython.com/courses/solid-principles-python/continue/#t=83.58 |
| but it has flavors of functional programming and object-oriented coding inside | https://realpython.com/courses/solid-principles-python/continue/#t=86.86 |
| of it. | https://realpython.com/courses/solid-principles-python/continue/#t=91.6 |
| 01:32 | https://realpython.com/courses/solid-principles-python/continue/#t=92.58 |
| This means you can choose how much or how little you use object-oriented | https://realpython.com/courses/solid-principles-python/continue/#t=92.58 |
| techniques when you code. It actually is very object-oriented underneath, | https://realpython.com/courses/solid-principles-python/continue/#t=96.67 |
| but you don’t have to use that mental abstraction if you don’t want to. | https://realpython.com/courses/solid-principles-python/continue/#t=101.61 |
| 01:46 | https://realpython.com/courses/solid-principles-python/continue/#t=106.28 |
| If you’re coming from other languages, | https://realpython.com/courses/solid-principles-python/continue/#t=106.28 |
| especially those which are object-oriented first, | https://realpython.com/courses/solid-principles-python/continue/#t=108.27 |
| this leap can be a bit of an adjustment. | https://realpython.com/courses/solid-principles-python/continue/#t=111.45 |
| If you’re an experienced coder in one language, | https://realpython.com/courses/solid-principles-python/continue/#t=113.96 |
| your first tendency when writing code in a new language is to use the style | https://realpython.com/courses/solid-principles-python/continue/#t=116.22 |
| you’re familiar with, even if it isn’t a good fit for your new language. | https://realpython.com/courses/solid-principles-python/continue/#t=120.36 |
| 02:05 | https://realpython.com/courses/solid-principles-python/continue/#t=125.76 |
| As a Python coder, | https://realpython.com/courses/solid-principles-python/continue/#t=125.76 |
| if you come across a lot of object-oriented code where you’re wondering why they | https://realpython.com/courses/solid-principles-python/continue/#t=127.16 |
| didn’t just use a dictionary, | https://realpython.com/courses/solid-principles-python/continue/#t=131.46 |
| there’s a good chance the original writer was an ex-Java person or something | https://realpython.com/courses/solid-principles-python/continue/#t=132.93 |
| similar. Once you do decide to write some object-oriented code, | https://realpython.com/courses/solid-principles-python/continue/#t=137.9 |
| whether in Python or any other language, | https://realpython.com/courses/solid-principles-python/continue/#t=142.33 |
| there are some guiding principles that should be followed. | https://realpython.com/courses/solid-principles-python/continue/#t=144.9 |
| 02:28 | https://realpython.com/courses/solid-principles-python/continue/#t=148.16 |
| This course is primarily about those principles. | https://realpython.com/courses/solid-principles-python/continue/#t=148.16 |
| You want to write clean code that can be supported by others. | https://realpython.com/courses/solid-principles-python/continue/#t=151.31 |
| Structure your code for reuse following the DRY— | https://realpython.com/courses/solid-principles-python/continue/#t=156.57 |
| that’s don’t repeat yourself—principle, | https://realpython.com/courses/solid-principles-python/continue/#t=159.63 |
| and you also want to take advantage of duck typing or, more formally, | https://realpython.com/courses/solid-principles-python/continue/#t=162.27 |
| polymorphism, where the interface to the object determines how it is used, | https://realpython.com/courses/solid-principles-python/continue/#t=166.01 |
| and it can be passed around to other code, | https://realpython.com/courses/solid-principles-python/continue/#t=170.59 |
| which doesn’t have to be concerned with its underlying implementation. | https://realpython.com/courses/solid-principles-python/continue/#t=172.73 |
| 02:57 | https://realpython.com/courses/solid-principles-python/continue/#t=177.49 |
| And once you start building classes on top of each other, | https://realpython.com/courses/solid-principles-python/continue/#t=177.49 |
| you want to do so in a fashion where you aren’t designing yourself into a | https://realpython.com/courses/solid-principles-python/continue/#t=180.02 |
| corner, keeping your code flexible for future changes. | https://realpython.com/courses/solid-principles-python/continue/#t=183.56 |
| 03:07 | https://realpython.com/courses/solid-principles-python/continue/#t=187.88 |
| There’s an acronym out there that can help you think about these ideas. | https://realpython.com/courses/solid-principles-python/continue/#t=187.88 |
| It’s named SOLID, the expansion of which is confusing, and a paragraph full, | https://realpython.com/courses/solid-principles-python/continue/#t=192.0 |
| so I won’t call it anything but SOLID until you get to that part of the course. | https://realpython.com/courses/solid-principles-python/continue/#t=196.75 |
| 03:23 | https://realpython.com/courses/solid-principles-python/continue/#t=203.04 |
| Before spending some time on SOLID, | https://realpython.com/courses/solid-principles-python/continue/#t=203.04 |
| let’s talk about whether you should orient your objects at all. | https://realpython.com/courses/solid-principles-python/continue/#t=205.39 |
| Become a Member | https://realpython.com/account/join/ |
| Overview | https://realpython.com/courses/solid-principles-python/ |
| https://realpython.com/videos/when-to-use-classes-python/ |
|
Design and Guidance: OOP in Python (Overview) 03:30
| https://realpython.com/videos/solid-principles-python-overview/ |
|
The Decision to Use Classes 10:27
| https://realpython.com/videos/when-to-use-classes-python/ |
|
Single Responsibility 03:31
| https://realpython.com/lessons/single-responsibility-principle/ |
|
Open-Closed 05:23
| https://realpython.com/lessons/open-closed-principle/ |
|
Liskov Substitution 05:03
| https://realpython.com/lessons/liskov-substitution-principle/ |
|
Interface Segregation 03:28
| https://realpython.com/lessons/interface-segregation/ |
|
Dependency Inversion 03:31
| https://realpython.com/lessons/dependency-inversion/ |
|
Design and Guidance: OOP in Python (Summary) 02:46
| https://realpython.com/lessons/solid-principles-python-summary/ |
| Privacy Policy | https://realpython.com/privacy-policy/ |
Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover