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

@@ -2,7 +2,7 @@ import array
import threading
import weakref
from Queue import Queue
from typing import Any, List
from typing import Any
class DummyProcess(threading.Thread):
_children: weakref.WeakKeyDictionary[Any, Any]
@@ -35,7 +35,7 @@ JoinableQueue = Queue
def Array(typecode, sequence, lock=...) -> array.array[Any]: ...
def Manager() -> Any: ...
def Pool(processes=..., initializer=..., initargs=...) -> Any: ...
def active_children() -> List[Any]: ...
def active_children() -> list[Any]: ...
def current_process() -> threading.Thread: ...
def freeze_support() -> None: ...
def shutdown() -> None: ...

View File

@@ -1,7 +1,7 @@
from Queue import Queue
from typing import Any, List, Tuple
from typing import Any
families: List[None]
families: list[None]
class Connection(object):
_in: Any
@@ -22,4 +22,4 @@ class Listener(object):
def close(self) -> None: ...
def Client(address) -> Connection: ...
def Pipe(duplex=...) -> Tuple[Connection, Connection]: ...
def Pipe(duplex=...) -> tuple[Connection, Connection]: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, Iterable, Iterator, List
from typing import Any, Callable, Iterable, Iterator
class AsyncResult:
def get(self, timeout: float | None = ...) -> Any: ...
@@ -20,15 +20,15 @@ class Pool(object):
initargs: Iterable[Any] = ...,
maxtasksperchild: int | None = ...,
) -> None: ...
def apply(self, func: Callable[..., Any], args: Iterable[Any] = ..., kwds: Dict[str, Any] = ...) -> Any: ...
def apply(self, func: Callable[..., Any], args: Iterable[Any] = ..., kwds: dict[str, Any] = ...) -> Any: ...
def apply_async(
self,
func: Callable[..., Any],
args: Iterable[Any] = ...,
kwds: Dict[str, Any] = ...,
kwds: dict[str, Any] = ...,
callback: Callable[..., None] | None = ...,
) -> AsyncResult: ...
def map(self, func: Callable[..., Any], iterable: Iterable[Any] = ..., chunksize: int | None = ...) -> List[Any]: ...
def map(self, func: Callable[..., Any], iterable: Iterable[Any] = ..., chunksize: int | None = ...) -> list[Any]: ...
def map_async(
self,
func: Callable[..., Any],