mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Add precise types for underlying queue objects (#7157)
This commit is contained in:
@@ -18,6 +18,8 @@ class Queue(Generic[_T]):
|
||||
not_full: Condition # undocumented
|
||||
all_tasks_done: Condition # undocumented
|
||||
unfinished_tasks: int # undocumented
|
||||
# Despite the fact that `queue` has `deque` type,
|
||||
# we treat it as `Any` to allow different implementations in subtypes.
|
||||
queue: Any # undocumented
|
||||
def __init__(self, maxsize: int = ...) -> None: ...
|
||||
def _init(self, maxsize: int) -> None: ...
|
||||
@@ -36,8 +38,11 @@ class Queue(Generic[_T]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
class PriorityQueue(Queue[_T]): ...
|
||||
class LifoQueue(Queue[_T]): ...
|
||||
class PriorityQueue(Queue[_T]):
|
||||
queue: list[_T]
|
||||
|
||||
class LifoQueue(Queue[_T]):
|
||||
queue: list[_T]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class SimpleQueue(Generic[_T]):
|
||||
|
||||
Reference in New Issue
Block a user