Use PEP 585 syntax in typing and typing_extensions, and remove module-level defaults where possible (#7036)

This commit is contained in:
Alex Waygood
2022-01-25 15:13:36 +00:00
committed by GitHub
parent bfda5c640b
commit 5d07ebc864
4 changed files with 72 additions and 72 deletions

View File

@@ -42,14 +42,14 @@ def runtime_checkable(cls: _TC) -> _TC: ...
# This alias for above is kept here for backwards compatibility.
runtime = runtime_checkable
Protocol: _SpecialForm = ...
Final: _SpecialForm = ...
Self: _SpecialForm = ...
Required: _SpecialForm = ...
NotRequired: _SpecialForm = ...
Final: _SpecialForm
Self: _SpecialForm
Required: _SpecialForm
NotRequired: _SpecialForm
def final(f: _F) -> _F: ...
Literal: _SpecialForm = ...
Literal: _SpecialForm
def IntVar(name: str) -> Any: ... # returns a new TypeVar
@@ -76,7 +76,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta):
def __delitem__(self, k: NoReturn) -> None: ...
# TypedDict is a (non-subscriptable) special form.
TypedDict: object = ...
TypedDict: object
OrderedDict = _Alias()
@@ -90,8 +90,8 @@ if sys.version_info >= (3, 7):
def get_args(tp: Any) -> tuple[Any, ...]: ...
def get_origin(tp: Any) -> Any | None: ...
Annotated: _SpecialForm = ...
_AnnotatedAlias: Any = ... # undocumented
Annotated: _SpecialForm
_AnnotatedAlias: Any # undocumented
@runtime_checkable
class SupportsIndex(Protocol, metaclass=abc.ABCMeta):
@@ -126,7 +126,7 @@ else:
def args(self) -> ParamSpecArgs: ...
@property
def kwargs(self) -> ParamSpecKwargs: ...
Concatenate: _SpecialForm = ...
TypeAlias: _SpecialForm = ...
TypeGuard: _SpecialForm = ...
Concatenate: _SpecialForm
TypeAlias: _SpecialForm
TypeGuard: _SpecialForm
def is_typeddict(tp: object) -> bool: ...