Skip to content
Myr

Merge pull request #2256 from Jonxslays/patch/typing-fix

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by GitHub · parents 6f35455, 4695370 · Browse files · 2 files+7 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−4 removed

  • other:+7 added−4 removed

2 files+7 added−4 removed

modified:src/click/decorators.py+4 added-4 removed
147 unmodified lines
148 ...149150151def command(152 name: t.Union[str, t.Callable, None] = None,152 name: t.Union[str, t.Callable[..., t.Any], None] = None,153 cls: t.Optional[t.Type[Command]] = None,154 **attrs: t.Any,155) -> t.Union[Command, t.Callable[..., Command]]:156 r"""Creates a new :class:`Command` and uses the decorated function as
24 unmodified lines
181 The ``params`` argument can be used. Decorated params are182 appended to the end of the list.183 """184185 func: t.Optional[t.Callable] = None185 func: t.Optional[t.Callable[..., t.Any]] = None186187 if callable(name):188 func = name189 name = None
37 unmodified lines
227228229@t.overload230def group(231 __func: t.Callable,231 __func: t.Callable[..., t.Any],232) -> Group:233 ...234235
5 unmodified lines
241 ...242243244def group(245 name: t.Union[str, t.Callable, None] = None, **attrs: t.Any245 name: t.Union[str, t.Callable[..., t.Any], None] = None, **attrs: t.Any246) -> t.Union[Group, t.Callable[[F], Group]]:247 """Creates a new :class:`Group` with a function as callback. This248 works otherwise the same as :func:`command` just that the `cls`249 parameter is set to :class:`Group`.
248 unmodified lines
modified:CHANGES.rst+3 added
3 unmodified lines
4-------------56Unreleased78- Use verbose form of ``typing.Callable`` for ``@command`` and9 ``@group``. :issue:`2255`101112Version 8.1.213-------------1415Released 2022-03-31
1026 unmodified lines