--- id: overrides version: "7.7.0" license: Apache License, Version 2.0 license_treatment: permissive maintenance: active --- # overrides — A decorator to automatically detect mismatch when overriding a method. License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install overrides uv add overrides poetry add overrides ## Description 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... ## AI interpretation — verify before relying 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. 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. [View on SkillFed](https://skillfed.io/packages/overrides) · [View on PyPI](https://pypi.org/project/overrides/)