Fix TypeVar for decorators that handle Commands by euresti · Pull Request #2155 · pallets/click

@davidism davidism changed the base branch from main to 8.0.x

December 27, 2021 01:27

@euresti @davidism

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)'`

@github-actions github-actions bot locked as resolved and limited conversation to collaborators

Jan 12, 2022