---
source: https://iinventedlight.com/library/notes/python-typing-override.md
title: "Mark a subclass method with typing.override"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Public-Domain (Python PEPs); PSF-2.0 (Python docs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python PEPs, PEP 698 – Override Decorator for Static Typing; Python docs, typing — Support for type hints. Public-Domain; PSF-2.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-19
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-19
as_of: 2026-11-19
confidence: medium
untested: "Not reproduced (2026-11-19). 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.override and PEP 698"
tags: [python, typing, override, pep-698]
client: Librarian
sources:
  - id: S1
    title: "PEP 698 – Override Decorator for Static Typing"
    publisher: Python PEPs
    url: https://peps.python.org/pep-0698/
    accessed: 2026-11-19
    license: "Public-Domain"
  - id: S2
    title: "typing — Support for type hints"
    publisher: Python docs
    url: https://docs.python.org/3/library/typing.html
    accessed: 2026-11-19
    license: "PSF-2.0"
---
# Mark a subclass method with typing.override
**Answer:** `override` marks a method in a subclass that is intended to override a method or attribute in a superclass. PEP 698 adds it to the Python type system so type checkers can catch bugs when a base class changes methods inherited by derived classes.

## What type checkers do

Type checkers should emit an error if the decorated method does not, in fact, override anything. That helps prevent bugs when a base class is refactored.

## When to write it

The decorator is for static typing. Type checkers should emit an error if the method does not, in fact, override anything.

| @override | type checker |
|---|---|
| override | Decorator on a subclass method or attribute |
| superclass | The method or attribute being overridden |
| emit an error | When the decorated method does not override anything |
| refactor | A base class change can break derived classes |

## See also

- [python-typing-annotations](https://iinventedlight.com/library/notes/python-typing-annotations/)
- [python-exceptions-hierarchy](https://iinventedlight.com/library/notes/python-exceptions-hierarchy/)
- [python-dataclasses](https://iinventedlight.com/library/notes/python-dataclasses/)

## Claims

- id: C1
  claim: PEP 698 adds an @override decorator so type checkers can catch broken inherited methods.
  source: S1
  evidence: "adding an @override decorator to the Python type system"

- id: C2
  claim: That helps when a base class changes methods that derived classes inherit.
  source: S1
  evidence: "when a base class changes methods that are inherited by derived classes"

- id: C3
  claim: Type checkers should emit an error if @override does not override anything.
  source: S2
  evidence: "Type checkers should emit an error if a method decorated with @override"

## Sources

- [S1] PEP 698 – Override Decorator for Static Typing. Python PEPs. https://peps.python.org/pep-0698/ . License: Public-Domain. Accessed 2026-11-19.

- [S2] typing — Support for type hints. Python docs. https://docs.python.org/3/library/typing.html . License: PSF-2.0. Accessed 2026-11-19.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python PEPs, PEP 698 – Override Decorator for Static Typing; Python docs, typing — Support for type hints. Public-Domain; PSF-2.0. Text was condensed and changed from the originals.

---

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