Skip to content

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

stdlib/select.pyi

Lines changed: 13 additions & 12 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, TypeVar, final
6-
from typing_extensions import Never, Self
5+
from typing import Any, ClassVar, Final, TypeVar, final, overload
6+
from typing_extensions import Never, Self, deprecated
77

88
if sys.platform != "win32":
99
PIPE_BUF: Final[int]
@@ -52,13 +52,7 @@ if sys.platform != "linux" and sys.platform != "win32":
5252
ident: int
5353
udata: Any
5454
def __init__(
55-
self,
56-
ident: FileDescriptorLike,
57-
filter: int = ...,
58-
flags: int = ...,
59-
fflags: int = ...,
60-
data: Any = ...,
61-
udata: Any = ...,
55+
self, ident: FileDescriptorLike, filter: int = ..., flags: int = ..., fflags: int = 0, data: Any = 0, udata: Any = 0
6256
) -> None: ...
6357
__hash__: ClassVar[None] # type: ignore[assignment]
6458

@@ -118,12 +112,19 @@ if sys.platform != "linux" and sys.platform != "win32":
118112
if sys.platform == "linux":
119113
@final
120114
class epoll:
121-
def __new__(self, sizehint: int = ..., flags: int = ...) -> Self: ...
115+
@overload
116+
def __new__(self, sizehint: int = -1) -> Self: ...
117+
@overload
118+
@deprecated(
119+
"The `flags` parameter is deprecated since Python 3.4. "
120+
"Use `os.set_inheritable()` to make the file descriptor inheritable."
121+
)
122+
def __new__(self, sizehint: int = -1, flags: int = 0) -> Self: ...
122123
def __enter__(self) -> Self: ...
123124
def __exit__(
124125
self,
125126
exc_type: type[BaseException] | None = None,
126-
exc_value: BaseException | None = ...,
127+
exc_value: BaseException | None = None,
127128
exc_tb: TracebackType | None = None,
128129
/,
129130
) -> None: ...
@@ -164,4 +165,4 @@ if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win
164165
def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ...
165166
def modify(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ...
166167
def unregister(self, fd: FileDescriptorLike) -> None: ...
167-
def poll(self, timeout: float | None = ...) -> list[tuple[int, int]]: ...
168+
def poll(self, timeout: float | None = None) -> list[tuple[int, int]]: ...

0 commit comments

Comments
 (0)