Skip to content
Myr

Merge pull request #2103 from angus-lherrou:update-flake8-typing-imports

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

use alias for `t.overload` with flake8 4.0

authored by David Lord · committed by GitHub · parents e338880, 1e561ec · Browse files · 3 files+10 added−13 removed
This commit

State

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

Diff stats

3 files+10 added−13 removed

  • other:+10 added−13 removed

3 files+10 added−13 removed

modified:src/click/core.py+8 added-9 removed
1import enum2import errno3import os4import sys5import typing5import typing as t6from collections import abc7from contextlib import contextmanager8from contextlib import ExitStack
621 unmodified lines
630 if rv is None:631 self.obj = rv = object_type()632 return rv633635 @typing.overload634 @t.overload635 def lookup_default(636 self, name: str, call: "te.Literal[True]" = True637 ) -> t.Optional[t.Any]:638 ...639641 @typing.overload640 @t.overload641 def lookup_default(642 self, name: str, call: "te.Literal[False]" = ...643 ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:644 ...
309 unmodified lines
954 )955956 return results957959 @typing.overload958 @t.overload959 def main(960 self,961 args: t.Optional[t.Sequence[str]] = None,962 prog_name: t.Optional[str] = None,
2 unmodified lines
965 **extra: t.Any,966 ) -> "te.NoReturn":967 ...968970 @typing.overload969 @t.overload970 def main(971 self,972 args: t.Optional[t.Sequence[str]] = None,973 prog_name: t.Optional[str] = None,
1196 unmodified lines
2170 metavar += "..."21712172 return metavar21732175 @typing.overload2174 @t.overload2175 def get_default(2176 self, ctx: Context, call: "te.Literal[True]" = True2177 ) -> t.Optional[t.Any]:2178 ...21792181 @typing.overload2180 @t.overload2181 def get_default(2182 self, ctx: Context, call: bool = ...2183 ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:2184 ...
566 unmodified lines
2751 help = f"{help} [{extra_str}]" if help else f"[{extra_str}]"27522753 return ("; " if any_prefix_is_slash else " / ").join(rv), help27542756 @typing.overload2755 @t.overload2756 def get_default(2757 self, ctx: Context, call: "te.Literal[True]" = True2758 ) -> t.Optional[t.Any]:2759 ...27602762 @typing.overload2761 @t.overload2762 def get_default(2763 self, ctx: Context, call: bool = ...2764 ) -> t.Optional[t.Union[t.Any, t.Callable[[], t.Any]]]:2765 ...
187 unmodified lines
modified:src/click/globals.py+2 added-3 removed
1import typing1import typing as t2from threading import local34if t.TYPE_CHECKING:
2 unmodified lines
78_local = local()91012@typing.overload11@t.overload12def get_current_context(silent: "te.Literal[False]" = False) -> "Context":13 ...141517@typing.overload16@t.overload17def get_current_context(silent: bool = ...) -> t.Optional["Context"]:18 ...1920
48 unmodified lines
modified:src/click/termui.py-1 removed
1 unmodified line
2import io3import itertools4import os5import sys6import typing6import typing as t7from gettext import gettext as _89from ._compat import isatty
797 unmodified lines