From: Ben Darnell Date: Tue, 1 Jan 2019 15:29:22 +0000 (-0500) Subject: queues: Add a note to Queue.get about difference from stdlib X-Git-Tag: v6.0.0b1~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2564%2Fhead;p=thirdparty%2Ftornado.git 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 --- 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: