Python
peps.python.org › pep-0544
PEP 544 – Protocols: Structural subtyping (static duck typing) | peps.python.org
March 5, 2017 - In this PEP we specify static and runtime semantics of protocol classes that will provide a support for structural subtyping (static duck typing). Currently, PEP 484 and the typing module [typing] define abstract base classes for several common ...
Python
typing.python.org › en › latest › spec › protocol.html
Protocols — typing documentation
Specification for the Python type system » · Protocols · | Theme · Auto · Light · Dark | (Originally specified in PEP 544.) The term protocols is used for some types supporting structural subtyping.
Videos
15:31
Protocols vs ABCs in Python - When to Use Which One? - YouTube
10:10
You NEED to know about Python protocols - YouTube
09:16
Exploring Protocols in Python: Understanding & Creating Custom ...
08:32
What are "Protocols" In Python? (Tutorial 2023) - YouTube
Protocols in Python: Why You Need Them
00:59
What’s a Protocol Class in Python? - YouTube
Mypy
mypy.readthedocs.io › en › stable › protocols.html
Protocols and structural subtyping - mypy 1.19.1 documentation
Structural subtyping can be seen as a static equivalent of duck typing, which is well known to Python programmers. See PEP 544 for the detailed specification of protocols and structural subtyping in Python.
GitHub
github.com › python › peps › pull › 224
PEP 544: Protocols by ilevkivskyi · Pull Request #224 · python/peps
I believe David is more skeptical of this PEP than Jukka and I. But even so, the extra frustrating thing is that, indeed, the PEP process (by convention at least) prefers to have a reference implementation to support a proposal, without any guarantees that the reference implementation will ever be deployed. This is similar to the RFC-based IETF standardization process for internet protocols -- and the similarity is not coincidental, we modeled Python's PEP process after the RFC process (with which several core Python devs were highly familiar between 1995-2000).
Author python
Python
peps.python.org › pep-0001
PEP 1 – PEP Purpose and Guidelines | peps.python.org
PEP stands for Python Enhancement Proposal. A PEP is a design document providing information to the Python community, or describing a new feature for Python or its processes or environment.
Python
peps.python.org
PEP 0 – Index of Python Enhancement Proposals (PEPs) | peps.python.org
This PEP contains the index of all Python Enhancement Proposals, known as PEPs. PEP numbers are assigned by the PEP editors, and once assigned are never changed. The version control history of the PEP texts represent their historical record.
Hashnode
fronkan.hashnode.dev › a-first-look-at-python-protocols-pep-544
A First Look at Python Protocols (PEP 544) - Fredrik Sjöstrand
October 5, 2020 - @runtime_checkable class Printable(Protocol): @abstractmethod def print(self) -> None: raise NotImplementedError ... PEP 544 gives us protocols that allow us to define what requirements a function or class has for a parameter.
Python
peps.python.org › pep-0813
PEP 813 – The Pretty Print Protocol | peps.python.org
3 weeks ago - This PEP describes the “pretty print protocol”, a collection of changes proposed to make pretty printing more customizable and convenient.
Python
peps.python.org › pep-0008
PEP 8 – Style Guide for Python Code | peps.python.org
PEP 207 indicates that reflexivity rules are assumed by Python. Thus, the interpreter may swap y > x with x < y, y >= x with x <= y, and may swap the arguments of x == y and x != y. The sort() and min() operations are guaranteed to use the < ...
Sarahabd
sarahabd.com › sarah abderemane's website › til › python protocol typing
TIL: python Protocol and typing
December 18, 2024 - Protocol was created in Python 3.8 with the PEP 544. There a multiple protocols in python but the one I’m talking about is a way to define structural typing. Some of you will also call that implicit interface. We can use the Protocol class from the typing module.
Python
typing.python.org › en › latest › reference › protocols.html
Protocols and structural subtyping — typing documentation
Structural subtyping can be seen as a static equivalent of duck typing, which is well known to Python programmers. See PEP 544 for the detailed specification of protocols and structural subtyping in Python.
Nickypy
nickypy.com › blog › python-protocols
Notes on Python Protocols
Protocols in Python (PEP 544) allow for statically checking whether an object implements a specific method (see interfaces in Go, or traits in Rust).
Python
peps.python.org › pep-0519
PEP 519 – Adding a file system path protocol | peps.python.org
This PEP proposes a protocol for classes which represent a file system path to be able to provide a str or bytes representation. Changes to Python’s standard library are also proposed to utilize this protocol where appropriate to facilitate ...
Python Tutorial
pythontutorial.net › home › python oop › python protocol
Python Protocol - Python Tutorial
March 31, 2025 - To make the calculate_total() more dynamic while leveraging type hints, you can use the Protocol from the typing module. The Protocol class has been available since Python 3.8, described in PEP 544.