mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Use PEP 585 syntax in typing and typing_extensions, and remove module-level defaults where possible (#7036)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user