Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)

This commit is contained in:
Alex Waygood
2022-01-18 15:14:03 +00:00
committed by GitHub
parent aa885ecd65
commit 8af5e0d340
264 changed files with 2217 additions and 2411 deletions

View File

@@ -1,7 +1,7 @@
from typing import IO, Any, Callable, Iterator, Optional, Tuple, Type, Union
from typing import IO, Any, Callable, Iterator, Optional, Union
HIGHEST_PROTOCOL: int
bytes_types: Tuple[Type[Any], ...] # undocumented
bytes_types: tuple[type[Any], ...] # undocumented
def dump(obj: Any, file: IO[bytes], protocol: int | None = ...) -> None: ...
def dumps(obj: Any, protocol: int | None = ...) -> bytes: ...
@@ -14,10 +14,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: