skillfed

overrides

A decorator to automatically detect mismatch when overriding a method.

overrides Permissive license Apache License, Version 2.0 Active 270 v7.7.0 released

Install

overrides on PyPI

pip

pip install overrides

uv

uv add overrides

poetry

poetry add overrides

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 — typing
Maintenance actively maintained — 929 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: overrides-7.7.0-py3-none-any.whl

Keywords: override, inheritence, OOP

Intended Audience :: DevelopersProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

About overrides

from the package's own PyPI description — quoted content, verbatim

overrides

.. image:: https://img.shields.io/pypi/v/overrides.svg :target: https://pypi.python.org/pypi/overrides

.. image:: http://pepy.tech/badge/overrides :target: http://pepy.tech/project/overrides

A decorator @override that verifies that a method that should override an inherited method actually does it.

Copies the docstring of the inherited method to the overridden method.

Since signature validation and docstring inheritance are performed on class creation and not on class instantiation, this library significantly improves the safety and experience of creating class hierarchies in Python without significantly impacting performance. See https://stackoverflow.com/q/1167617 for the initial inspiration for this library.

Motivation

Python has no standard mechanism by which to guarantee that (1) a method that previously overrode an inherited method continues to do so, and (2) a method that previously did not override an inherited will not override now. This opens the door for subtle problems as class hierarchies evolve over time. For example,

  1. A method that is added to a superclass is shadowed by an existing method with the same name in a...

Read as markdown · JSON record · Source repository · Homepage

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

overrides provides a decorator-based mechanism to validate that methods in subclasses correctly override parent class methods, catching signature mismatches and missing overrides at class definition time, while automatically inheriting parent docstrings.

Installation is straightforward with minimal friction—the package is a pure-Python wheel with only the standard library's typing module as a runtime dependency, and maintenance is active with a recent release in January 2024.

Licensed under Apache License 2.0 (permissive), allowing use in both open-source and proprietary projects with minimal restrictions beyond attribution.

Usage

pip install overrides

from overrides import override, EnforceOverrides

class Parent(EnforceOverrides):
    def method(self):
        """Parent docstring."""
        return 1

class Child(Parent):
    @override
    def method(self):
        return 2

Requires Python 3.6 or later; @classmethod and @staticmethod must be declared before @override.

Verdict: overrides is a lightweight, well-maintained tool for catching inheritance bugs early in development. With no security vulnerabilities, permissive licensing, and a single standard-library dependency, it's a low-risk addition to any Python 3.6+ project that uses class hierarchies. The decorator-based approach integrates cleanly into existing codebases and provides immediate value through signature validation and docstring inheritance.

Needs verification

  • Whether the package's test coverage and CI/CD practices meet production standards
  • Performance impact of signature validation on large class hierarchies at scale
method override decorator pythoninheritance validation class hierarchydetect override mismatchdocstring inheritance decoratorsignature checking overrideenforce method overrideOOP inheritance safety

Similar packages