Use PEP 570 syntax in stdlib (#11250)

This commit is contained in:
Shantanu
2024-03-09 14:50:16 -08:00
committed by GitHub
parent 63737acac6
commit 470a13ab09
139 changed files with 2412 additions and 2371 deletions

View File

@@ -28,7 +28,7 @@ class poll:
def poll(self, timeout: float | None = ...) -> list[tuple[int, int]]: ...
def select(
__rlist: Iterable[Any], __wlist: Iterable[Any], __xlist: Iterable[Any], __timeout: float | None = None
rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], timeout: float | None = None, /
) -> tuple[list[Any], list[Any], list[Any]]: ...
error = OSError
@@ -60,11 +60,11 @@ if sys.platform != "linux" and sys.platform != "win32":
def __init__(self) -> None: ...
def close(self) -> None: ...
def control(
self, __changelist: Iterable[kevent] | None, __maxevents: int, __timeout: float | None = None
self, changelist: Iterable[kevent] | None, maxevents: int, timeout: float | None = None, /
) -> list[kevent]: ...
def fileno(self) -> int: ...
@classmethod
def fromfd(cls, __fd: FileDescriptorLike) -> kqueue: ...
def fromfd(cls, fd: FileDescriptorLike, /) -> kqueue: ...
KQ_EV_ADD: int
KQ_EV_CLEAR: int
@@ -112,9 +112,10 @@ if sys.platform == "linux":
def __enter__(self) -> Self: ...
def __exit__(
self,
__exc_type: type[BaseException] | None = None,
__exc_value: BaseException | None = ...,
__exc_tb: TracebackType | None = None,
exc_type: type[BaseException] | None = None,
exc_value: BaseException | None = ...,
exc_tb: TracebackType | None = None,
/,
) -> None: ...
def close(self) -> None: ...
closed: bool
@@ -124,7 +125,7 @@ if sys.platform == "linux":
def unregister(self, fd: FileDescriptorLike) -> None: ...
def poll(self, timeout: float | None = None, maxevents: int = -1) -> list[tuple[int, int]]: ...
@classmethod
def fromfd(cls, __fd: FileDescriptorLike) -> epoll: ...
def fromfd(cls, fd: FileDescriptorLike, /) -> epoll: ...
EPOLLERR: int
EPOLLEXCLUSIVE: int