I prefer ABCs beacuse they're explicit. With a Protocol someone reading the code may not know your class is intended to implement an interface in another module or deep in a dependency. Similarly, you can accidentally conform to a Protocol's signature, without conforming to its contract. For example, if a function accepts a

class Image(Protocol):
    def draw() -> None:
        ...

it's obviously not going to make sense with a

class Cowboy:
    def draw() -> None:
         ...

but the type checker would happily accept it.

Answer from joel on Stack Overflow
🌐
Reddit
reddit.com › r/python › python interfaces: choose protocols over abc
r/Python on Reddit: Python Interfaces: Choose Protocols Over ABC
February 12, 2023 - There is a substantial difference: abstract class ensures that an implementation meets certain requirements when a subclass is declared, while protocol checks if an instance meets certain requirements when it's being used.
🌐
Medium
medium.com › @pouyahallaj › introduction-1616b3a4a637
Python Protocols vs. ABCs: A Comprehensive Comparison of Interface Design | Medium
May 29, 2023 - The Rectangle and Circle classes inherit from Shape and implement the area method. The example illustrates that Protocols allow for more flexibility and compatibility across different types, as print_object can accept any object that satisfies the Printable Protocol. ABCs, on the other hand, enforce the implementation of the area method by subclasses and provide a structured way to define a common interface. Choosing between Python Protocols and Abstract Base Classes (ABCs) depends on the specific requirements and constraints of your project.
🌐
Justin A. Ellis
jellis18.github.io › post › 2022-01-11-abc-vs-protocol
Abstract Base Classes and Protocols: What Are They? When To Use Them?? Lets Find Out! - Justin A. Ellis
January 11, 2022 - Use ABCs if you will need several implementations of a class with several methods. Use Protocols for strict type annotations (i.e.only annotate the methods/attributes you need) ... Well, thats it for this time. Now go forth into our bold almost statically typed python future with confidence!
🌐
Sinavski
sinavski.com › home › interfaces abc vs. protocols
Interfaces: abc vs. Protocols - Oleg Sinavski
August 1, 2021 - But recently, I found that relatively new Python Protocols are way nicer. People find uses for both technologies. But I want to convince you to completely jump ships and start using them instead of more traditional techniques. Python is somewhat different from other popular languages since there are no interfaces on a language level. However, there are several library implementations: ... from abc import ABC, abstractmethod class Animal(ABC): @abstractmethod def eat(self, food) -> float: pass @abstractmethod def sleep(self, hours) -> float: pass
🌐
Old Dominion University
cs.odu.edu › ~tkennedy › cs263 › dev › Public › protocolVsABC › index.html
Protocol vs Abstract Base Class
Currently, PEP 484 and the typing module [typing] define abstract base classes for several common Python protocols such as Iterable and Sized. The problem with them is that a class has to be explicitly marked to support them, which is unpythonic and unlike what one would normally do in idiomatic ...
🌐
Reddit
reddit.com › r/python › protocols vs abstract base classes in python
r/Python on Reddit: Protocols vs Abstract Base Classes in Python
December 1, 2024 -

Hi everyone. Last time I shared a post about Interface programming using abs in Python, and it got a lot of positive feedback—thank you!

Several people mentioned protocols, so I wrote a new article exploring that topic. In it, I compare protocols with abstract base classes and share my thoughts and experiences with both. You can check it out here: https://www.tk1s.com/python/protocols-vs-abstract-base-classes-in-python Hope you'll like it! Thanks!

🌐
Hacker News
news.ycombinator.com › item
Where would you use `typing.Protocol` where you wouldn't use an abstract base cl... | Hacker News
March 19, 2021 - The only time I've ever used `Protocol` is to define a type that makes it explicit that I need an object to have a `__str__` implementation: · Abstract base classes require everything to extend from a base-level object, and also inherit it's default implementations.
Find elsewhere
🌐
GitHub
gist.github.com › Integralist › cc04c2c34a988be26e56fe2f3ea95aff
[Python Interfaces via Protocols and Abstract Base Classes (with Metaclasses)] #python #interfaces #protocols #design #collections #abc #iterator #sized #metaclasses #abstract · GitHub
Instead, Python provides 'protocols' which are a bit like the interface support in Go. They're not strictly enforced, but if you implement specific magic methods you'll find a selection of builtin Python functions become available to use on ...
🌐
GitConnected
levelup.gitconnected.com › python-interfaces-choose-protocols-over-abc-3982e112342e
Python interfaces: abandon ABC and switch to Protocols | by Oleg Sinavski | Level Up Coding
January 19, 2023 - Protocols allow you to define an interface for a function (not only a class) — see callback protocols. It is a very cool feature that is worthy of a separate post. There is a big downside to both abc and Protocols. In the real world, many people work in a single codebase. Abstract base classes sometimes tend to acquire default method implementations.
🌐
Reddit
reddit.com › r/python › interfaces with protocols: why not ditch abc for good?
r/Python on Reddit: Interfaces with Protocols: why not ditch ABC for good?
January 22, 2023 -

Hello, if one finds interfaces useful in Python (>=3.8) and is convinced that static type-checking is a must, then why not ditch ABC and always use Protocols? I understand that the fundamental idea of a protocol is slightly different from an interface, but in practice, I had great success replacing abc's with Protocols without regrets.

With abc you would write (https://docs.python.org/3/library/abc.html) :

from abc import ABC, abstractmethod

class Animal(ABC):
   @abstractmethod
   def eat(self, food) -> float:
       pass

Whereas with Protocols it's gonna be (good tutorial):

from typing import Protocol

class Animal(Protocol):
   def eat(self, food) -> float:
       ...

Scores in my subjective scoring system :)

CapabilityABCProtocols
Runtime checking11 (with a decorator)
Static checking with mypy11
Explicit interface (class Dog(Animal):)11
Implicit interface with duck-typing (class Dog:)0.5 (kind of with register, but it doesn't work with mypy yet)1
Default method implementation (def f(self): return 5)-1 (implementations shouldn't be in the interfaces)-1 (same, and mypy doesn't catch this)
Callback interface01
Number of code lines-1 (requires ABC inheritance and abstracmethod for every method)0 (optionalProtocol inheritance)
Total score1.54

So I do not quite see why one should ever use ABC except for legacy reasons. Other (IMHO minor) points in favour of ABC I've seen were about interactions with code editors.

Did I miss anything?

I put more detailed arguments into a Medium. There are many tutorials on using Protocols, but not many on ABC vs Protocols comparisons. I found a battle of Protocols vs Zope, but we are not using Zope, so it's not so relevant.

🌐
UW PCE
uwpce-pythoncert.github.io › Py300 › ABCs.html
Abstract Base Classes and standard class protocols — Py300 3.0 documentation
In particular, the protocols of the standard Python object types. They were added to Python to formalize the “Duck Typing” approach in some contexts. See PEP 3119 for the details: ... In OO languages, an “abstract” class is a class that has an interface, but no implementation.
🌐
DEV Community
dev.to › meseta › factories-abstract-base-classes-and-python-s-new-protocols-structural-subtyping-20bm
Python's new Protocols (Structural subtyping), Abstract Base Classes, and Factories - DEV Community
August 18, 2020 - That way there's no ambiguity about whether the documentation still matches the code, since this definition of the class is what is used at runtime, and will error out if the implementation was incorrect. Python has a built-in library for this called abc which stands for Abstract Base Class.
🌐
Jarombek
jarombek.com › blog › dec-15-2018-python-protocols-abcs
From Protocols to ABCs in Python
Software Engineering Website · Developing Software Since Summer 2016
🌐
TypeThePipe
typethepipe.com › post › python-protocols-when-to-use
Python protocols. When to use them in your projects to abstract and decoupling | TypeThePipe
December 11, 2023 - This functionality is integrated into the structure of these classes. Protocols, on the other hand, are more generic and loosely coupled. They are used primarily for type checking, allowing Python to understand that certain classes are ...
🌐
YouTube
youtube.com › arjancodes
Protocol Or ABC In Python - When to Use Which One? - YouTube
💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide.When should you use protocol classes vs abstract base classes? Here's an ex...
Published   October 29, 2021
Views   204K
🌐
Python
typing.python.org › en › latest › spec › protocol.html
Protocols — typing documentation
If Protocol is included in the base class list, all the other base classes must be protocols. A protocol can’t extend a regular class. Note that rules around explicit subclassing are different from regular ABCs, where abstractness is simply defined by having at least one abstract method being unimplemented.
🌐
Medium
medium.com › algomart › abstract-base-classes-vs-protocols-in-python-a-real-world-perspective-bdc85b74f48c
Abstract Base Classes vs. Protocols in Python: A Real-World Perspective | by Yash Jain | AlgoMart | Medium
June 18, 2025 - Abstract Base Classes vs. Protocols in Python: A Real-World Perspective Why You Need to Know This When you’re developing serious Python applications — the kind that stick around, get handed over …
🌐
Han
han8931.github.io › python-protocol-abstract-classes
Abstract Classes or Protocols - Han's XYZ
September 15, 2025 - An abstract class in Python is a class that cannot be instantiated on its own and is designed to be a blueprint for other classes. It allows you to define methods that must be created within any child classes built from the abstract class.
🌐
how.wtf
how.wtf › abc-vs-protocol-in-python.html
ABC vs Protocol in Python | how.wtf
December 16, 2023 - Before typing was released for Python, the ABC class reigned as champion for describing shape and behaviors of classes. After type annotations, ABC and @abstractmethod were still used to describe the behaviors: they felt ‘interface-like’. Then, Protocol was released and introduced a new way for declaring class behaviors.