Skip to content

Commit c453da9

Browse files
authored
Add TypeVars for the Iterators in select.select (#15022)
1 parent 0c0bad8 commit c453da9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

stdlib/select.pyi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import sys
22
from _typeshed import FileDescriptorLike
33
from collections.abc import Iterable
44
from types import TracebackType
5-
from typing import Any, ClassVar, Final, final
6-
from typing_extensions import Self
5+
from typing import Any, ClassVar, Final, TypeVar, final
6+
from typing_extensions import Never, Self
77

88
if sys.platform != "win32":
99
PIPE_BUF: Final[int]
@@ -31,9 +31,13 @@ if sys.platform != "win32":
3131
def unregister(self, fd: FileDescriptorLike, /) -> None: ...
3232
def poll(self, timeout: float | None = None, /) -> list[tuple[int, int]]: ...
3333

34+
_R = TypeVar("_R", default=Never)
35+
_W = TypeVar("_W", default=Never)
36+
_X = TypeVar("_X", default=Never)
37+
3438
def select(
35-
rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], timeout: float | None = None, /
36-
) -> tuple[list[Any], list[Any], list[Any]]: ...
39+
rlist: Iterable[_R], wlist: Iterable[_W], xlist: Iterable[_X], timeout: float | None = None, /
40+
) -> tuple[list[_R], list[_W], list[_X]]: ...
3741

3842
error = OSError
3943

0 commit comments

Comments
 (0)