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,6 +1,6 @@
import sys
from _typeshed import FileDescriptorLike
from typing import Any, Iterable, List, Tuple
from typing import Any, Iterable
if sys.platform != "win32":
PIPE_BUF: int
@@ -21,11 +21,11 @@ class poll:
def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ...
def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ...
def unregister(self, fd: FileDescriptorLike) -> None: ...
def poll(self, timeout: float | None = ...) -> List[Tuple[int, int]]: ...
def poll(self, timeout: float | None = ...) -> list[tuple[int, int]]: ...
def select(
__rlist: Iterable[Any], __wlist: Iterable[Any], __xlist: Iterable[Any], __timeout: float | None = ...
) -> Tuple[List[Any], List[Any], List[Any]]: ...
) -> tuple[list[Any], list[Any], list[Any]]: ...
class error(Exception): ...
@@ -54,7 +54,7 @@ if sys.platform != "linux" and sys.platform != "win32":
def close(self) -> None: ...
def control(
self, __changelist: Iterable[kevent] | None, __maxevents: int, __timeout: float | None = ...
) -> List[kevent]: ...
) -> list[kevent]: ...
def fileno(self) -> int: ...
@classmethod
def fromfd(cls, __fd: FileDescriptorLike) -> kqueue: ...
@@ -106,7 +106,7 @@ if sys.platform == "linux":
def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ...
def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ...
def unregister(self, fd: FileDescriptorLike) -> None: ...
def poll(self, timeout: float | None = ..., maxevents: int = ...) -> List[Tuple[int, int]]: ...
def poll(self, timeout: float | None = ..., maxevents: int = ...) -> list[tuple[int, int]]: ...
@classmethod
def fromfd(cls, __fd: FileDescriptorLike) -> epoll: ...
EPOLLERR: int