diff options
-rw-r--r-- | CHANGES.rst | 2 | ||||
-rw-r--r-- | src/click/decorators.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index f46d446..92f69dc 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,8 @@ Unreleased - ``open_file`` recognizes ``Path("-")`` as a standard stream, the same as the string ``"-"``. :issue:`2106` +- The ``option`` and ``argument`` decorators preserve the type + annotation of the decorated function. :pr:`2155` Version 8.0.3 diff --git a/src/click/decorators.py b/src/click/decorators.py index f1cc005..7930a16 100644 --- a/src/click/decorators.py +++ b/src/click/decorators.py @@ -14,7 +14,7 @@ from .globals import get_current_context from .utils import echo F = t.TypeVar("F", bound=t.Callable[..., t.Any]) -FC = t.TypeVar("FC", t.Callable[..., t.Any], Command) +FC = t.TypeVar("FC", bound=t.Union[t.Callable[..., t.Any], Command]) def pass_context(f: F) -> F: |