---
source: https://iinventedlight.com/library/notes/python-typing-protocol.md
title: "Protocol describes structural subtyping for static duck typing"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF-2.0 (Python docs); Public domain or CC0-1.0 (Python PEPs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python docs, typing.Protocol, PSF-2.0 (https://docs.python.org/3/license.html); Python PEPs, PEP 544 – Protocols: Structural subtyping (static duck typing), Public domain or CC0-1.0 (https://peps.python.org/pep-0544/ (Copyright section: public domain))."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: typing Protocol"
tags: [python, protocol, typing, pep-544, structural]
client: Librarian
sources:
  - id: S1
    title: "typing.Protocol"
    publisher: Python docs
    url: https://docs.python.org/3/library/typing.html
    accessed: 2026-11-16
    license: "PSF-2.0"
  - id: S2
    title: "PEP 544 – Protocols: Structural subtyping (static duck typing)"
    publisher: Python PEPs
    url: https://peps.python.org/pep-0544/
    accessed: 2026-11-16
    license: "Public domain or CC0-1.0"
---
# Protocol describes structural subtyping for static duck typing
**Answer:** `Protocol` is the base class for protocol classes. Protocol classes are defined like `class Proto(Protocol)` with a `meth` method. Static type checkers that recognize structural subtyping (static duck-typing) are the main consumers of those classes.

The example defines `class C` with `def meth(self) -> int`. Then `func(C())` passes a static type check.

## PEP 544

PEP 484 specifies the semantics of nominal subtyping. This PEP specifies static and runtime semantics of protocol classes. Those protocol classes provide support for structural subtyping (static duck typing).

## See also

- [python-typing-annotations](https://iinventedlight.com/library/notes/python-typing-annotations/)
- [python-unittest](https://iinventedlight.com/library/notes/python-unittest/)
- [python-typeddict](https://iinventedlight.com/library/notes/python-typeddict/)
- [mypy-type-checker](https://iinventedlight.com/library/notes/mypy-type-checker/)

## Claims

- id: C1
  claim: Protocol is the base class for protocol classes.
  source: S1
  evidence: "Base class for protocol classes."

- id: C2
  claim: Protocol classes are used with structural subtyping.
  source: S1
  evidence: "structural subtyping (static duck-typing), for example:"

- id: C3
  claim: PEP 544 specifies semantics of protocol classes.
  source: S2
  evidence: "static and runtime semantics of protocol classes that will provide a support"

- id: C4
  claim: The PEP targets structural subtyping, also called static duck typing.
  source: S2
  evidence: "for *structural* subtyping (static duck typing)."

## Sources

- [S1] typing.Protocol. Python docs. https://docs.python.org/3/library/typing.html . License: PSF-2.0. Accessed 2026-11-16.

- [S2] PEP 544 – Protocols: Structural subtyping (static duck typing). Python PEPs. https://peps.python.org/pep-0544/ . License: Public domain or CC0-1.0. Accessed 2026-11-16.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python docs, typing.Protocol, PSF-2.0 (https://docs.python.org/3/license.html); Python PEPs, PEP 544 – Protocols: Structural subtyping (static duck typing), Public domain or CC0-1.0 (https://peps.python.org/pep-0544/ (Copyright section: public domain)). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
