About 430,000 results
Open links in new tab
  1. Python Protocols vs. ABCs: A Comprehensive Comparison of

    May 29, 2023 · In this article, we will dive into the world of Python Protocols and ABCs, exploring their individual characteristics and discussing the scenarios where one might be more suitable …

  2. Abstract Base Classes and Protocols: What Are They? When To …

    Jan 11, 2022 · In Python there are two similar, yet different, concepts for defining something akin to an interface, or a contract describing what methods and attributes a class will contain. …

  3. Interfaces with Protocols: why not ditch ABC for good? : r/Python

    Jan 22, 2023 · Personally, I don't see any reasons to use ABC when you can use Protocols in exactly the same manner, but Protocols can also be used for structural typing. It's not just for …

  4. Abstract Base Classes (ABCs) and Protocols in python

    Jun 9, 2025 · We’ll explore ideas like nominal vs structural typing, and static vs dynamic checks — all of which play a key role in how ABCs and Protocols work. To begin, let’s explore the …

  5. Python Protocols vs ABC: Why Modern Interfaces Deserve a

    Sep 1, 2025 · Confused between Python Protocols and Abstract Base Classes? Discover why Protocols are the smarter, flexible choice for modern interface design.

  6. ABC vs Protocol in Python - how.wtf

    Dec 16, 2023 · Abstract Base Classes, or ABC, is a a module that provides infrastructure to define abstract classes in Python. As previously stated, they predated type hinting and were …

  7. Protocols vs Abstract Base Classes in Python - tk1s.com

    Python offers two powerful tools for this purpose: Protocols and Abstract Base Classes (ABCs). While both help define what an object should do, they cater to different scenarios and …

    Missing:
    • abc
    Must include:
  8. Interfaces, Protocols, and ABCs - Mastering Python

    In Python, the concept of a protocol refers to an informal interface. With the integration of PEP 544—Protocols: Structural subtyping (static duck typing) in Python 3.8, the term protocol has …

  9. Interfaces: abc vs. Protocols - Oleg Sinavski

    Protocols do not force you to opt-in, but you can establish a company-wide rule to explicitly inherit from any protocol. abc also support implicit interfaces through the concept of “virtual subclasses”.

  10. Modern Python Interfaces: ABC, Protocol, or Both?

    Python’s interface story splits into two philosophies. ABCs belong to the “nominal” world — you declare you are something by inheriting from a base class. Python enforces abstract methods …