Understanding Python: Abstract Base Classes

Поделиться
HTML-код
  • Опубликовано: 31 мар 2023
  • In this video, I go over abstract base classes.
    Included in the lesson is how to create a basic abstract base class with abstract methods as well as the basis for a powerful plugin system.
    As always, if you have any questions or suggestions for future videos, please leave a comment down below.
    Follow me on twitter: / jakejcallahan
    Source: github.com/JacobCallahan/Unde...
    Timelapse music: 失望した by Eva
    Link: • EVA - 失望した [Synthwave]...
    Outro music: Elix by Synthness
    Link: • Synthness - Elix ★ No ...
  • НаукаНаука

Комментарии • 17

  • @JakeCallahan
    @JakeCallahan  Год назад +5

    If you find some great examples of ABCs in the wild, please reply to this comment with a link!

    • @sanithumabarna
      @sanithumabarna Год назад

      Can you explain how descripters in python works ?

    • @JakeCallahan
      @JakeCallahan  Год назад +1

      I sure can. In fact, I'll move that up to be the subject of my next video.

    • @JakeCallahan
      @JakeCallahan  Год назад +1

      You asked for it, so you got it!
      ruclips.net/video/3QqURpf7Wjs/видео.html

    • @halfbakedthoughts4150
      @halfbakedthoughts4150 9 месяцев назад

      ​​@@JakeCallahancame here after your descriptor video.. you are a blessing... to stick to your word and getting it done so quick..
      Looking forward to more of such great videos from you
      I would just request one thing to start with a real life use case as to why we would prefer these concepts implemented before jumping on to how it works

    • @JakeCallahan
      @JakeCallahan  9 месяцев назад +1

      @halfbakedthoughts4150 thank you for the kind words and feedback. I like to build up towards the more practical examples, but I can definitely see how showing practical could be motivational.

  • @toxfux
    @toxfux 10 месяцев назад +1

    very nice explaination. Thanks!

  • @TheMako101
    @TheMako101 7 месяцев назад

    Excellent tutorial, @JakeCallahan. You've covered the material beautifully, especially the "register" functionality. I've read the official docs and had no idea what it was talking about 😅. Now it's crystal clear! Thank you !!

  • @dragonkat13
    @dragonkat13 Год назад +1

    great video! informative and easy to understand as usual! thanks!

  • @hackytech7494
    @hackytech7494 10 месяцев назад

    Thank you so much.

  • @ShuCarolina
    @ShuCarolina 2 дня назад

    Where does the plugin() in line 23 come from? I don't see it in this ServicePlugin class.

  • @magno5157
    @magno5157 4 месяца назад +1

    What's the difference between abstractmethod and abc.abstractclassmethod?

    • @JakeCallahan
      @JakeCallahan  4 месяца назад +1

      The second is used for methods decorated with @classmethod. If you're unsure what those are, check out my video in this playlist on Basic Classes.

    • @magno5157
      @magno5157 4 месяца назад

      @@JakeCallahan ah... so it's just @abstractmethod @classmethod in a single decorator

    • @JakeCallahan
      @JakeCallahan  4 месяца назад +1

      You're correct! However, abstractclassmethod was deprecated almost immediately after being introduced because they enabled the classmethod decorator to decorate an abstractmethod.
      So to do this, just stack a classmethod decorator on top of the abstractmethod decorator.

    • @magno5157
      @magno5157 4 месяца назад

      @@JakeCallahan I see but seeing that you use it, I guess people still widely use the decorator?

    • @JakeCallahan
      @JakeCallahan  4 месяца назад +1

      While you can use it for now, it will be removed in the future, so best to avoid it.