mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
fix(stubs/click): don't force autocompleter to accept anything as context (#5265)
* fix(stubs/click): don't force autocompleter to accept anything as context Additionally it's enough if it's return value is iterable (e.g. a generator).
This commit is contained in:
committed by
GitHub
parent
fe4acabdd7
commit
b0c6598fba
@@ -1,5 +1,5 @@
|
||||
from distutils.version import Version
|
||||
from typing import Any, Callable, Dict, List, Optional, Protocol, Text, Tuple, Type, TypeVar, Union, overload
|
||||
from typing import Any, Callable, Dict, Iterable, List, Optional, Protocol, Text, Tuple, Type, TypeVar, Union, overload
|
||||
|
||||
from click.core import Argument, Command, Context, Group, Option, Parameter, _ConvertibleType
|
||||
|
||||
@@ -71,7 +71,7 @@ def argument(
|
||||
expose_value: bool = ...,
|
||||
is_eager: bool = ...,
|
||||
envvar: Optional[Union[str, List[str]]] = ...,
|
||||
autocompletion: Optional[Callable[[Any, List[str], str], List[Union[str, Tuple[str, str]]]]] = ...,
|
||||
autocompletion: Optional[Callable[[Context, List[str], str], Iterable[Union[str, Tuple[str, str]]]]] = ...,
|
||||
) -> _IdentityFunction: ...
|
||||
@overload
|
||||
def option(
|
||||
|
||||
Reference in New Issue
Block a user