Skip to content

Commit

Permalink
Merge pull request #1866 from pallets/typing-shell_complete
Browse files Browse the repository at this point in the history
more accurate custom shell_complete annotation
  • Loading branch information
davidism committed May 3, 2021
2 parents fc4ebb8 + 3a39cb2 commit 0f645cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/click/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2022,7 +2022,8 @@ def __init__(
envvar: t.Optional[t.Union[str, t.Sequence[str]]] = None,
shell_complete: t.Optional[
t.Callable[
[Context, "Parameter", str], t.List[t.Union["CompletionItem", str]]
[Context, "Parameter", str],
t.Union[t.List["CompletionItem"], t.List[str]],
]
] = None,
autocompletion: t.Optional[
Expand Down Expand Up @@ -2068,7 +2069,7 @@ def __init__(

def shell_complete(
ctx: Context, param: "Parameter", incomplete: str
) -> t.List[t.Union["CompletionItem", str]]:
) -> t.List["CompletionItem"]:
from click.shell_completion import CompletionItem

out = []
Expand Down

0 comments on commit 0f645cc

Please sign in to comment.