summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Lord <davidism@gmail.com>2021-12-26 15:55:17 -0700
committerDavid Lord <davidism@gmail.com>2021-12-26 15:55:17 -0700
commite4ef249cbdeda3cf15acf662a329cb451a679b8b (patch)
tree3e537126b37eaedff948ef5ad608c1f61290ed68 /src
parent9e9fe41a53d885d96e43dec7cd9eb69e352f801a (diff)
parent69dfb1e5fff0e2f88d3a2c4bc375674a9eae5f68 (diff)
downloadclick-e4ef249cbdeda3cf15acf662a329cb451a679b8b.tar.gz
Merge remote-tracking branch 'origin/8.0.x'
Diffstat (limited to 'src')
-rw-r--r--src/click/core.py17
-rw-r--r--src/click/globals.py5
-rw-r--r--src/click/termui.py1
3 files changed, 10 insertions, 13 deletions
diff --git a/src/click/core.py b/src/click/core.py
index cbf02b6..96c6377 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -2,7 +2,6 @@ import enum
import errno
import os
import sys
-import typing
import typing as t
from collections import abc
from contextlib import contextmanager
@@ -632,13 +631,13 @@ class Context:
self.obj = rv = object_type()
return rv
- @typing.overload
+ @t.overload
def lookup_default(
self, name: str, call: "te.Literal[True]" = True
) -> t.Optional[t.Any]:
...
- @typing.overload
+ @t.overload
def lookup_default(
self, name: str, call: "te.Literal[False]" = ...
) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:
@@ -956,7 +955,7 @@ class BaseCommand:
return results
- @typing.overload
+ @t.overload
def main(
self,
args: t.Optional[t.Sequence[str]] = None,
@@ -967,7 +966,7 @@ class BaseCommand:
) -> "te.NoReturn":
...
- @typing.overload
+ @t.overload
def main(
self,
args: t.Optional[t.Sequence[str]] = None,
@@ -2126,13 +2125,13 @@ class Parameter:
return metavar
- @typing.overload
+ @t.overload
def get_default(
self, ctx: Context, call: "te.Literal[True]" = True
) -> t.Optional[t.Any]:
...
- @typing.overload
+ @t.overload
def get_default(
self, ctx: Context, call: bool = ...
) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:
@@ -2714,13 +2713,13 @@ class Option(Parameter):
return ("; " if any_prefix_is_slash else " / ").join(rv), help
- @typing.overload
+ @t.overload
def get_default(
self, ctx: Context, call: "te.Literal[True]" = True
) -> t.Optional[t.Any]:
...
- @typing.overload
+ @t.overload
def get_default(
self, ctx: Context, call: bool = ...
) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:
diff --git a/src/click/globals.py b/src/click/globals.py
index a7b0c93..480058f 100644
--- a/src/click/globals.py
+++ b/src/click/globals.py
@@ -1,4 +1,3 @@
-import typing
import typing as t
from threading import local
@@ -9,12 +8,12 @@ if t.TYPE_CHECKING:
_local = local()
-@typing.overload
+@t.overload
def get_current_context(silent: "te.Literal[False]" = False) -> "Context":
...
-@typing.overload
+@t.overload
def get_current_context(silent: bool = ...) -> t.Optional["Context"]:
...
diff --git a/src/click/termui.py b/src/click/termui.py
index 82253a2..2a37785 100644
--- a/src/click/termui.py
+++ b/src/click/termui.py
@@ -3,7 +3,6 @@ import io
import itertools
import os
import sys
-import typing
import typing as t
from gettext import gettext as _