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

@@ -1,11 +1,11 @@
import sys
from typing import Any, Callable, ClassVar, Iterable, Iterator, Mapping, Optional, Protocol, Tuple, Type, Union
from typing import Any, Callable, ClassVar, Iterable, Iterator, Mapping, Optional, Protocol, Type, Union
from typing_extensions import final
HIGHEST_PROTOCOL: int
DEFAULT_PROTOCOL: int
bytes_types: Tuple[Type[Any], ...] # undocumented
bytes_types: tuple[Type[Any], ...] # undocumented
class _ReadableFileobj(Protocol):
def read(self, __n: int) -> bytes: ...
@@ -58,10 +58,10 @@ class UnpicklingError(PickleError): ...
_reducedtype = Union[
str,
Tuple[Callable[..., Any], Tuple[Any, ...]],
Tuple[Callable[..., Any], Tuple[Any, ...], Any],
Tuple[Callable[..., Any], Tuple[Any, ...], Any, Optional[Iterator[Any]]],
Tuple[Callable[..., Any], Tuple[Any, ...], Any, Optional[Iterator[Any]], Optional[Iterator[Any]]],
tuple[Callable[..., Any], tuple[Any, ...]],
tuple[Callable[..., Any], tuple[Any, ...], Any],
tuple[Callable[..., Any], tuple[Any, ...], Any, Optional[Iterator[Any]]],
tuple[Callable[..., Any], tuple[Any, ...], Any, Optional[Iterator[Any]], Optional[Iterator[Any]]],
]
class Pickler: