Python Interfaces - Understanding Informal Interfaces

Sdílet
Vložit
  • čas přidán 5. 06. 2024
  • This is a preview of the video course, "Python Interfaces: Object-Oriented Design Principles." Interfaces play an important role in software engineering. As an application grows, updates and changes to the code base become more difficult to manage. More often than not, you wind up having classes that look very similar but are unrelated, which can lead to some confusion.
    This is a portion of the complete course, which you can find here:
    realpython.com/courses/interf...
    The rest of the course takes you through how to:
    - Understand how interfaces work and the caveats of Python interface creation
    - Comprehend how useful interfaces are in a dynamic language like Python
    - Implement an informal Python interface
    - Use abc.ABCMeta and @abc.abstractmethod to implement a formal Python interface

Komentáře • 1

  • @derekreed6798
    @derekreed6798 Před dnem

    I'm confused. Doesn't ducktyping 'inherit' implicitly not explicitly as its a Protocol interface (and thus you can't use isinstance and issubclass)?