skillfed

types-decorator

Typing stubs for decorator

types-decorator v5.2.0.20260712 1.3M downloads/30d#4,061 on PyPI37
Permissive license Apache-2.0 Active released

What it is and what it does

This package is a type stub—a collection of type annotations without runtime code—that teaches type checkers how to understand the `decorator` library. When you install it alongside `decorator` version 5.2.x, tools like mypy and pyright can now check your code for type errors when you use decorators, catching mistakes before runtime. The stubs are maintained as part of the typeshed project, a centralized repository of type information for popular Python packages.

However, this stub is primarily useful for older versions of `decorator`. Since `decorator` version 5.3.0, the package includes its own type annotations, making this stub redundant. If you are already using `decorator` 5.3.0 or later, you should uninstall `types-decorator` and rely on the built-in types instead.

Use it for:

  • Type-checking code that uses `decorator` 5.2.x with mypy or pyright in a CI/CD pipeline.
  • Enabling IDE autocomplete and type hints for decorator patterns in projects locked to `decorator` 5.2.x.
  • Validating decorator-based function wrappers in a codebase before upgrading to newer `decorator` versions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides type stubs for the `decorator` package, enabling type checkers like mypy and pyright to validate code that uses decorator patterns without runtime overhead.

Yes, if you are using `decorator` version 5.2.x and want type checking support. No, if you are already on `decorator` 5.3.0 or later—uninstall this stub and use the built-in types instead. The package is actively maintained and has no known vulnerabilities, but its utility is narrowly scoped to a specific decorator version range.

Install

types-decorator on PyPI

pip

pip install types-decorator

uv

uv add types-decorator

poetry

poetry add types-decorator

Installing types-decorator

Before you install

Low friction install with no runtime dependencies. Actively maintained as part of typeshed; last release 33 days ago. Note: the `decorator` package itself includes type annotations since version 5.3.0, making this stub package redundant for newer decorator versions.

License in practice

Apache-2.0 permissive license; no restrictions on use, modification, or distribution in most contexts.

Quickstart

pip install types-decorator

# Then use decorator in your code; type checkers will now understand its types
import decorator

@decorator.decorator
def my_decorator(func, *args, **kwargs):
    return func(*args, **kwargs)

Requires Python 3.10 or later. Only useful if you are using `decorator` version 5.2.x; decorator 5.3.0+ includes its own type annotations and this stub is not needed.

Verify before relying

  • Whether mypy 2.2.0 and pyright 1.1.411 represent current or outdated versions of those type checkers.
  • Whether there are known issues or gaps in type coverage beyond what the typeshed commit hash documents.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 33 days since the last release
Last repo commit
First released
Downloads 1,323,965/month — #4,061 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: types_decorator-5.2.0.20260712-py3-none-any.whl

Programming Language :: Python :: 3Typing :: Stubs Only

Tags

type stubs for decoratordecorator type hintsmypy decorator annotationspyright decorator typestyping stubs typeshed
type-stubstypeshed

More Software Development packages