We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 951c0b8 commit 1c78402Copy full SHA for 1c78402
4 files changed
stdlib/@tests/stubtest_allowlists/common.txt
@@ -445,7 +445,7 @@ multiprocessing.reduction.AbstractReducer.ForkingPickler
445
multiprocessing.pool.Pool.__del__
446
447
# C signature is broader than what is actually accepted
448
-queue.SimpleQueue.__init__
+_?queue.SimpleQueue.__init__
449
450
# Items that depend on the existence and flags of SSL
451
imaplib.IMAP4_SSL.ssl
stdlib/VERSIONS
@@ -52,6 +52,7 @@ _osx_support: 3.0-
52
_posixsubprocess: 3.2-
53
_py_abc: 3.7-
54
_pydecimal: 3.5-
55
+_queue: 3.7-
56
_random: 3.0-
57
_sitebuiltins: 3.4-
58
_socket: 3.0- # present in 3.0 at runtime, but not in typeshed
stdlib/_queue.pyi
@@ -0,0 +1,20 @@
1
+import sys
2
+from typing import Any, Generic, TypeVar
3
+
4
+if sys.version_info >= (3, 9):
5
+ from types import GenericAlias
6
7
+_T = TypeVar("_T")
8
9
+class Empty(Exception): ...
10
11
+class SimpleQueue(Generic[_T]):
12
+ def __init__(self) -> None: ...
13
+ def empty(self) -> bool: ...
14
+ def get(self, block: bool = True, timeout: float | None = None) -> _T: ...
15
+ def get_nowait(self) -> _T: ...
16
+ def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ...
17
+ def put_nowait(self, item: _T) -> None: ...
18
+ def qsize(self) -> int: ...
19
+ if sys.version_info >= (3, 9):
20
+ def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
stdlib/queue.pyi
@@ -1,4 +1,5 @@
import sys
+from _queue import Empty as Empty, SimpleQueue as SimpleQueue
from threading import Condition, Lock
from typing import Any, Generic, TypeVar
@@ -11,7 +12,6 @@ if sys.version_info >= (3, 13):
_T = TypeVar("_T")
-class Empty(Exception): ...
class Full(Exception): ...
if sys.version_info >= (3, 13):
@@ -55,14 +55,3 @@ class PriorityQueue(Queue[_T]):
class LifoQueue(Queue[_T]):
queue: list[_T]
-
59
-class SimpleQueue(Generic[_T]):
60
- def __init__(self) -> None: ...
61
- def empty(self) -> bool: ...
62
- def get(self, block: bool = True, timeout: float | None = None) -> _T: ...
63
- def get_nowait(self) -> _T: ...
64
- def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ...
65
- def put_nowait(self, item: _T) -> None: ...
66
- def qsize(self) -> int: ...
67
- if sys.version_info >= (3, 9):
68
- def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
0 commit comments