summaryrefslogtreecommitdiff
path: root/CHANGES.rst
diff options
context:
space:
mode:
authorDavid Euresti <david@euresti.com>2021-12-17 12:03:41 -0800
committerDavid Lord <davidism@gmail.com>2021-12-28 10:25:02 -0800
commit03963b2e7de4a9f835534df75f79eea4ee04fcc3 (patch)
tree1828a605fe9b9dc07bad75c465f8a467fcd17ba4 /CHANGES.rst
parent490ac01891e726c8b70a700b91da6c137699382a (diff)
downloadclick-03963b2e7de4a9f835534df75f79eea4ee04fcc3.tar.gz
Fix TypeVar for decorators that handle Commands
The old type var would throw away the types of Callables. ``` import click @click.option("--name", prompt="Your name", help="The person to greet.") def hello(name: str) -> None: ... reveal_type(hello) # note: Revealed type is 'def (*Any, **Any) -> Any' ``` With this small adjustment mypy now knows that it's a `'def (name: builtins.str)'`
Diffstat (limited to 'CHANGES.rst')
-rw-r--r--CHANGES.rst2
1 files changed, 2 insertions, 0 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