Add TypeVars for the Iterators in select.select (#15022)

This commit is contained in:
Gabe R.
2025-11-14 13:26:19 -07:00
committed by GitHub
parent 0c0bad8831
commit c453da93bf
+8 -4
View File
@@ -2,8 +2,8 @@ import sys
from _typeshed import FileDescriptorLike
from collections.abc import Iterable
from types import TracebackType
from typing import Any, ClassVar, Final, final
from typing_extensions import Self
from typing import Any, ClassVar, Final, TypeVar, final
from typing_extensions import Never, Self
if sys.platform != "win32":
PIPE_BUF: Final[int]
@@ -31,9 +31,13 @@ if sys.platform != "win32":
def unregister(self, fd: FileDescriptorLike, /) -> None: ...
def poll(self, timeout: float | None = None, /) -> list[tuple[int, int]]: ...
_R = TypeVar("_R", default=Never)
_W = TypeVar("_W", default=Never)
_X = TypeVar("_X", default=Never)
def select(
rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], timeout: float | None = None, /
) -> tuple[list[Any], list[Any], list[Any]]: ...
rlist: Iterable[_R], wlist: Iterable[_W], xlist: Iterable[_X], timeout: float | None = None, /
) -> tuple[list[_R], list[_W], list[_X]]: ...
error = OSError