From b17e7349881ab7503ae113b744f0a57f6a612156 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Tue, 1 Jan 2019 10:29:22 -0500 Subject: [PATCH] queues: Add a note to Queue.get about difference from stdlib Tornado's interpretation of the timeout argument differs from the stdlib's queue. Fixes #2370 --- tornado/queues.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tornado/queues.py b/tornado/queues.py index d135c3cb0..19ff6c66c 100644 --- a/tornado/queues.py +++ b/tornado/queues.py @@ -232,6 +232,16 @@ class Queue(Generic[_T]): scale as `tornado.ioloop.IOLoop.time`, normally `time.time`), or a `datetime.timedelta` object for a deadline relative to the current time. + + .. note:: + + The ``timeout`` argument of this method differs from that + of the standard library's `queue.Queue.get`. That method + interprets numeric values as relative timeouts; this one + interprets them as absolute deadlines and requires + ``timedelta`` objects for relative timeouts (consistent + with other timeouts in Tornado). + """ future = Future() # type: Future[_T] try: -- 2.47.2