Incorrect type hint when @command uses a custom class

The @command decorator is annotated as always returning Command.

This is a problem when supplying custom class, e.g.:

@click.command(cls=MyClass)
def foo():
     ...

reveal_type(foo)  # revealed type is `Command`
foo.my_property = 6  # error: `Command` does not have a member `my_property`

Environment:

  • Python version: any
  • Click version: 8.x