Use PEP 585 syntax wherever possible (#6717)

This commit is contained in:
Alex Waygood
2021-12-28 10:31:43 +00:00
committed by GitHub
parent e6cb341d94
commit 8d5d2520ac
237 changed files with 966 additions and 1069 deletions

View File

@@ -23,7 +23,7 @@ from types import (
if sys.version_info >= (3, 7):
from types import ClassMethodDescriptorType, WrapperDescriptorType, MemberDescriptorType, MethodDescriptorType
from typing import Any, ClassVar, NamedTuple, Protocol, Tuple, Type, TypeVar, Union
from typing import Any, ClassVar, NamedTuple, Protocol, Type, TypeVar, Union
from typing_extensions import Literal, TypeGuard
#
@@ -234,7 +234,7 @@ class Parameter:
class BoundArguments:
arguments: OrderedDict[str, Any]
args: Tuple[Any, ...]
args: tuple[Any, ...]
kwargs: dict[str, Any]
signature: Signature
def __init__(self, signature: Signature, arguments: OrderedDict[str, Any]) -> None: ...
@@ -262,14 +262,14 @@ if sys.version_info < (3, 11):
args: list[str]
varargs: str | None
keywords: str | None
defaults: Tuple[Any, ...]
defaults: tuple[Any, ...]
def getargspec(func: object) -> ArgSpec: ...
class FullArgSpec(NamedTuple):
args: list[str]
varargs: str | None
varkw: str | None
defaults: Tuple[Any, ...] | None
defaults: tuple[Any, ...] | None
kwonlyargs: list[str]
kwonlydefaults: dict[str, Any] | None
annotations: dict[str, Any]
@@ -291,7 +291,7 @@ if sys.version_info < (3, 11):
args: list[str],
varargs: str | None = ...,
varkw: str | None = ...,
defaults: Tuple[Any, ...] | None = ...,
defaults: tuple[Any, ...] | None = ...,
kwonlyargs: Sequence[str] | None = ...,
kwonlydefaults: dict[str, Any] | None = ...,
annotations: dict[str, Any] = ...,
@@ -313,7 +313,7 @@ def formatargvalues(
formatvarkw: Callable[[str], str] | None = ...,
formatvalue: Callable[[Any], str] | None = ...,
) -> str: ...
def getmro(cls: type) -> Tuple[type, ...]: ...
def getmro(cls: type) -> tuple[type, ...]: ...
def getcallargs(__func: Callable[..., Any], *args: Any, **kwds: Any) -> dict[str, Any]: ...
class ClosureVars(NamedTuple):