Skip to content

Commit 2be356f

Browse files
authored
[waitress] Replace FloatInt with proper types (#16952)
1 parent cb7a1e7 commit 2be356f

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎stubs/waitress/waitress/channel.pyi‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from _typeshed import FloatInt
21
from collections.abc import Sequence
32
from socket import _RetAddress, socket
43
from threading import Condition, Lock
@@ -19,7 +18,7 @@ class HTTPChannel(wasyncore.dispatcher):
1918
error_task_class: type[ErrorTask]
2019
parser_class: type[HTTPRequestParser]
2120
request: HTTPRequestParser | None
22-
last_activity: FloatInt
21+
last_activity: float
2322
will_close: bool
2423
close_when_flushed: bool
2524
requests: Sequence[HTTPRequestParser]
@@ -29,7 +28,7 @@ class HTTPChannel(wasyncore.dispatcher):
2928
server: BaseWSGIServer
3029
adj: Adjustments
3130
outbufs: Sequence[OverflowableBuffer]
32-
creation_time: FloatInt
31+
creation_time: float
3332
sendbuf_len: int
3433
task_lock: Lock
3534
outbuf_lock: Condition

‎stubs/waitress/waitress/wasyncore.pyi‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from _typeshed import FloatInt, ReadableBuffer
2+
from _typeshed import ReadableBuffer
33
from collections.abc import Mapping
44
from io import BytesIO
55
from logging import Logger
@@ -16,12 +16,14 @@ class ExitNow(Exception): ...
1616
def read(obj: dispatcher) -> None: ...
1717
def write(obj: dispatcher) -> None: ...
1818
def readwrite(obj: dispatcher, flags: int) -> None: ...
19-
def poll(timeout: FloatInt = 0.0, map: _SocketMap | None = None) -> None: ...
20-
def poll2(timeout: FloatInt = 0.0, map: _SocketMap | None = None) -> None: ...
19+
def poll(timeout: float | int = 0.0, map: _SocketMap | None = None) -> None: ...
20+
def poll2(timeout: float | int = 0.0, map: _SocketMap | None = None) -> None: ...
2121

2222
poll3 = poll2
2323

24-
def loop(timeout: FloatInt = 30.0, use_poll: bool = False, map: _SocketMap | None = None, count: int | None = None) -> None: ...
24+
def loop(
25+
timeout: float | int = 30.0, use_poll: bool = False, map: _SocketMap | None = None, count: int | None = None
26+
) -> None: ...
2527
def compact_traceback() -> tuple[tuple[str, str, str], BaseException, BaseException, str]: ...
2628

2729
class dispatcher:

0 commit comments

Comments
 (0)