Python Interfaces and Abstract Base Class (ABC): A Must-Know for Advanced Programmers

Sdílet
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

Komentáře • 18

  • @dhananjayharidas4327
    @dhananjayharidas4327 Před 14 dny

    Great explanation

  • @estevaoyt
    @estevaoyt Před 5 měsíci +1

    Beautiful explanation, now it's clear to me the difference between an abstract class and an interface. Keep it up!

  • @DominikJagoda
    @DominikJagoda Před měsícem

    Nice explanation, thanks !

  • @elias6406
    @elias6406 Před 3 měsíci

    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.

  • @adeolaogunleye7965
    @adeolaogunleye7965 Před měsícem

    Nice video, I really enjoyed it.

  • @JefferyHarrold
    @JefferyHarrold Před 5 měsíci +3

    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?

    • @k0nze_builds
      @k0nze_builds  Před 5 měsíci +1

      You are absolutely correct. I actually made a mistake while recording, the listings in the accompaniment blog article show the correct code.

  • @danielschmider5069
    @danielschmider5069 Před 2 měsíci

    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?

  • @sharimiqbal5803
    @sharimiqbal5803 Před 15 dny

    What ide you are using?

  • @ajaynarayanan2326
    @ajaynarayanan2326 Před měsícem

    Nice video

  • @esbee296
    @esbee296 Před 2 měsíci

    🖥

  • @pepijnkrijnsen4
    @pepijnkrijnsen4 Před 2 měsíci

    💻

  • @2sourcerer
    @2sourcerer Před měsícem +1

    Doesn't quite explain what "ABC" is for. Removing it doesn't break things.

    • @2sourcerer
      @2sourcerer Před měsícem +1

      Oh i see, that abstractmethod decorator has no effect unless subclassing an ABC. But still doesn't explain why the Animal class needs it.

    • @amersulaiman1827
      @amersulaiman1827 Před 22 dny

      It makes the class abstract, so it can't create an object feom it directly, but from another class that inherits it

  • @jmcoxD
    @jmcoxD Před 2 měsíci

    🖥

  • @godray25
    @godray25 Před měsícem

    🖥