From c4125739e5ce8a41cadfb8d99573ae7d0530c484 Mon Sep 17 00:00:00 2001 From: Onno Kortmann Date: Fri, 11 Nov 2016 19:29:52 +0100 Subject: [PATCH] The timeout argument to Queue.{get,put} may be None (#682) Python 2 and 3. --- stdlib/2/Queue.pyi | 2 +- stdlib/3/queue.pyi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/2/Queue.pyi b/stdlib/2/Queue.pyi index 2d64e1eaf..e1e41fbf3 100644 --- a/stdlib/2/Queue.pyi +++ b/stdlib/2/Queue.pyi @@ -20,7 +20,7 @@ class Queue(Generic[_T]): def qsize(self) -> int: ... def empty(self) -> bool: ... def full(self) -> bool: ... - def put(self, item: _T, block: bool = ..., timeout: float = ...) -> None: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... def put_nowait(self, item: _T) -> None: ... def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... def get_nowait(self) -> _T: ... diff --git a/stdlib/3/queue.pyi b/stdlib/3/queue.pyi index 28609a067..f85490d46 100644 --- a/stdlib/3/queue.pyi +++ b/stdlib/3/queue.pyi @@ -2,7 +2,7 @@ # NOTE: These are incomplete! -from typing import Any, TypeVar, Generic +from typing import Any, TypeVar, Generic, Optional _T = TypeVar('_T') @@ -12,9 +12,9 @@ class Full(Exception): ... class Queue(Generic[_T]): def __init__(self, maxsize: int = ...) -> None: ... def full(self) -> bool: ... - def get(self, block: bool = ..., timeout: float = ...) -> _T: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... def get_nowait(self) -> _T: ... - def put(self, item: _T, block: bool = ..., timeout: float = ...) -> None: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... def put_nowait(self, item: _T) -> None: ... def join(self) -> None: ... def qsize(self) -> int: ...