From a70f4893f83999149b135cd22b033528b12c1284 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Sun, 17 May 2020 18:05:52 -0700 Subject: [PATCH] Add undocumented attribute queue.Queue.queue with type Any. (#4032) This attribute was removed in https://github.com/python/typeshed/pull/3879 because it is undocumented and was annotated incorrectly. Unfortunately, a surprising (?) amount of Google code uses this attribute and assumes it is a deque, so it needs to exist but can't have a more general annotation like Collection[Any]. I also removed a no-longer-used typing.Deque import. --- stdlib/3/queue.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/3/queue.pyi b/stdlib/3/queue.pyi index f871eee3d..ba995e743 100644 --- a/stdlib/3/queue.pyi +++ b/stdlib/3/queue.pyi @@ -3,7 +3,7 @@ # NOTE: These are incomplete! from threading import Condition, Lock -from typing import Any, Deque, TypeVar, Generic, Optional +from typing import Any, TypeVar, Generic, Optional import sys _T = TypeVar('_T') @@ -19,6 +19,7 @@ class Queue(Generic[_T]): not_full: Condition # undocumented all_tasks_done: Condition # undocumented unfinished_tasks: int # undocumented + queue: Any # undocumented def __init__(self, maxsize: int = ...) -> None: ... def _init(self, maxsize: int) -> None: ...