From b514699a51f00a57f2368093480e51bc64a3d33c Mon Sep 17 00:00:00 2001 From: Luka Sterbic Date: Thu, 15 Feb 2018 18:34:47 +0000 Subject: [PATCH] Extend Py3 Queue type hints --- stdlib/3/queue.pyi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stdlib/3/queue.pyi b/stdlib/3/queue.pyi index 1eb7360fa9a4..3dcd88e2bb1a 100644 --- a/stdlib/3/queue.pyi +++ b/stdlib/3/queue.pyi @@ -2,6 +2,7 @@ # NOTE: These are incomplete! +from threading import Lock, Condition from typing import Any, TypeVar, Generic, Optional _T = TypeVar('_T') @@ -11,6 +12,11 @@ class Full(Exception): ... class Queue(Generic[_T]): maxsize = ... # type: int + mutex = ... # type: Lock + not_empty = ... # type: Condition + not_full = ... # type: Condition + all_tasks_done = ... # type: Condition + unfinished_tasks = ... # type: int def __init__(self, maxsize: int = ...) -> None: ... def _init(self, maxsize: int) -> None: ... def empty(self) -> bool: ...