overrides
A decorator to automatically detect mismatch when overriding a method.
Decision gist · record as of 2026-08-14
Yes. This is a low-friction, actively maintained library that solves real inheritance safety problems in Python class hierarchies. With no external dependencies beyond the standard library, permissive licensing, and zero known vulnerabilities, it's safe to add to any project. Install it if you have non-trivial class hierarchies and want to catch inheritance bugs early.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6 or later; signature validation runs at class definition time, so incompatible overrides raise immediately.
- Low friction: pure Python wheel with only the standard library's typing module as a runtime dependency.
- Actively maintained with recent commits; last release was in January 2024.
License · maintenance · safety
Apache License, Version 2.0 (permissive) — Apache License 2.0 (permissive) allows commercial and private use with minimal restrictions; you may use this in proprietary code provided you include a copy of the license.
last release 2024-01-27 (930 days) · last repo commit 2026-05-07 · 270 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 42,137,738 downloads/mo, #660 on PyPI
Alternatives
Verify before relying
from overrides import override
class Parent:
def method(self):
"""Parent docstring."""
return 1
class Child(Parent):
@override
def method(self):
return 2- Whether the library detects all common signature incompatibilities (e.g., added required parameters, changed return types) or only a subset.
- Performance overhead of signature validation on large class hierarchies at import time.
What it is and what it does
overrides is a lightweight decorator library that catches inheritance bugs by validating that methods marked with @override actually override a parent method and have compatible signatures. It also automatically copies parent docstrings to overridden methods, eliminating boilerplate documentation in class hierarchies. The validation happens at class definition time rather than runtime, so errors surface immediately during development.
The package addresses four common inheritance pitfalls: methods added to a parent that shadow existing subclass methods, renamed parent methods that leave orphaned overrides, removed parent methods that leave dead overrides, and signature mismatches between parent and child implementations. It also provides EnforceOverrides to require all shadowing methods to be explicitly marked, and @final to prevent specific methods from being overridden at all.
Use it for
- Catch accidental method shadowing when a new method is added to a parent class with the same name as an existing subclass method.
- Detect when a parent method is renamed but the subclass override is not updated, leaving dead code behind.
- Validate that overridden method signatures remain compatible as parent class APIs evolve.
- Enforce that all method overrides in a codebase are explicitly marked, preventing silent inheritance bugs.
- Automatically populate docstrings on overridden methods to improve IDE tooltips and linting compliance.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is a low-friction, actively maintained library that solves real inheritance safety problems in Python class hierarchies. With no external dependencies beyond the standard library, permissive licensing, and zero known vulnerabilities, it's safe to add to any project. Install it if you have non-trivial class hierarchies and want to catch inheritance bugs early.
Install
overrides on PyPI
Before you install
Low friction: pure Python wheel with only the standard library's typing module as a runtime dependency. Actively maintained with recent commits; last release was in January 2024.
Requires Python 3.6 or later; signature validation runs at class definition time, so incompatible overrides raise immediately.
License in practice
Apache License 2.0 (permissive) allows commercial and private use with minimal restrictions; you may use this in proprietary code provided you include a copy of the license.
Quickstart
from overrides import override
class Parent:
def method(self):
"""Parent docstring."""
return 1
class Child(Parent):
@override
def method(self):
return 2
Verify before relying
- Whether the library detects all common signature incompatibilities (e.g., added required parameters, changed return types) or only a subset.
- Performance overhead of signature validation on large class hierarchies at import time.
Package facts
| License | Apache License, Version 2.0 permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping |
| Maintenance | Actively maintained 930 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 42,137,738 / month, #660 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: overrides-7.7.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “method override validation”
- overridesProvides a @override decorator that validates method overrides match…
- json-fixPatches Python's built-in `json` module to recognize and call a…
- python-json-configLoads JSON configuration files and provides dot-notation access to…
Give your agent the search over MCP, or paste the wish link into any chat.
Similar packages
Automatically inherits docstrings from parent classes to child classes, eliminating duplicate documentation while supporting NumPy and Google docstring formats.
izulu provides a template-based, object-oriented approach to defining and raising exceptions with structured attributes and automatic message formatting.
Param provides declarative class attributes with runtime validation and a reactive programming API for automatic updates when attribute values change.
Install it if you need runtime parameter validation with class-level configuration, or if you're building interactive systems where automatic synchronization matters.
Validates that `__slots__` are correctly implemented across class hierarchies, detecting overlapping slots, inheritance errors, and duplicate slot definitions by running and inspecting your code.
A runtime type-checking decorator that validates function arguments against their type annotations and raises TypeMismatch on mismatch, with dedicated async support and mypyc compilation for performance.
Provides a metaclass-based system for building extensible APIs with enforced method signatures, automatic documentation stitching, and plugin registration hooks.
See also docsig · venusian · mo-kwargs · docstr-coverage