Python Interfaces and Abstract Base Class (ABC): A Must-Know for Advanced Programmers
Vložit
- čas přidán 27. 07. 2024
- Take your Python programming skills to the next level with this must-know topic: interfaces and abstract classes. Learn how to implement these important concepts in your code and become a more advanced programmer. We cover everything from basic syntax to real-world applications. Don't miss out on this essential tutorial!
👉 Website Article for this Video: k0nze.dev/posts/python-interf...
🛍️ Get my Cheatsheets on Gumroad: k0nze.gumroad.com
💌 Support me on Patreon: / k0nze
☕️ Buy me Coffee: www.buymeacoffee.com/k0nze
🌍 Check out my Website: k0nze.dev
💻 Join our Discord: discord.k0nze.dev
👔 Follow me on LinkedIn: linkedin.k0nze.dev
⏰ Timestamps:
0:00 Intro
0:35 Interfaces in Object-oriented Programming
1:35 Abstract Classes in Object-oriented Programming
2:13 Why Python doesn't have Interfaces and Abstract Classes
3:11 Python Duck-typing
4:55 Duck Test
5:51 Implementing an Abstract Class in Python
7:44 Implementing an Interface in Python
9:45 Outro
Great explanation
Beautiful explanation, now it's clear to me the difference between an abstract class and an interface. Keep it up!
Glad it was helpful!
Nice explanation, thanks !
I honestly don’t understand you don’t many views. I enjoyed your explanation. I would like to see a complete tutorial especially on oop and design patterns.
Nice video, I really enjoyed it.
The Talking interface and associated implemented Talking class...them having the same name and working, was that just a quirk of Python that shouldn't be encouraged because it will probably be fixed at a later date?
Looking at the autocomplete prompts that were coming up, probably from practicing, was the implemented Talking class supposed to be called TalkingDog?
You are absolutely correct. I actually made a mistake while recording, the listings in the accompaniment blog article show the correct code.
Giving the interface and the class the same name was weird, I was really surprised this actually worked! Is it because the Talking Class is defined later (further down) in the code?
What ide you are using?
Nice video
🖥
💻
Doesn't quite explain what "ABC" is for. Removing it doesn't break things.
Oh i see, that abstractmethod decorator has no effect unless subclassing an ABC. But still doesn't explain why the Animal class needs it.
It makes the class abstract, so it can't create an object feom it directly, but from another class that inherits it
🖥
🖥