Skip to content

Commit d79b8d0

Browse files
authored
Fix concurrent.interpreters.Queue interface for Python 3.14 (#14749)
1 parent a54c270 commit d79b8d0

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

stdlib/concurrent/interpreters/_queues.pyi

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,30 @@ if sys.version_info >= (3, 13): # needed to satisfy pyright checks for Python <
4545
def empty(self) -> bool: ...
4646
def full(self) -> bool: ...
4747
def qsize(self) -> int: ...
48-
def put(
49-
self,
50-
obj: object,
51-
timeout: SupportsIndex | None = None,
52-
*,
53-
unbounditems: _AnyUnbound | None = None,
54-
_delay: float = 0.01,
55-
) -> None: ...
48+
if sys.version_info >= (3, 14):
49+
def put(
50+
self,
51+
obj: object,
52+
block: bool = True,
53+
timeout: SupportsIndex | None = None,
54+
*,
55+
unbounditems: _AnyUnbound | None = None,
56+
_delay: float = 0.01,
57+
) -> None: ...
58+
else:
59+
def put(
60+
self,
61+
obj: object,
62+
timeout: SupportsIndex | None = None,
63+
*,
64+
unbounditems: _AnyUnbound | None = None,
65+
_delay: float = 0.01,
66+
) -> None: ...
67+
5668
def put_nowait(self, obj: object, *, unbounditems: _AnyUnbound | None = None) -> None: ...
57-
def get(self, timeout: SupportsIndex | None = None, *, _delay: float = 0.01) -> object: ...
69+
if sys.version_info >= (3, 14):
70+
def get(self, block: bool = True, timeout: SupportsIndex | None = None, *, _delay: float = 0.01) -> object: ...
71+
else:
72+
def get(self, timeout: SupportsIndex | None = None, *, _delay: float = 0.01) -> object: ...
73+
5874
def get_nowait(self) -> object: ...

0 commit comments

Comments
 (0)