]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Document (ignored) timeout argument to Future methods.
authorBen Darnell <ben@bendarnell.com>
Wed, 6 May 2015 05:04:09 +0000 (22:04 -0700)
committerBen Darnell <ben@bendarnell.com>
Wed, 6 May 2015 05:04:09 +0000 (22:04 -0700)
Closes #1435.

tornado/concurrent.py

index 51ae239fb8a53967363910d0781c896ab19ad236..479ca022ef399d36883837d92ee7b12f055ab57b 100644 (file)
@@ -203,6 +203,10 @@ class Future(object):
     def result(self, timeout=None):
         """If the operation succeeded, return its result.  If it failed,
         re-raise its exception.
+
+        This method takes a ``timeout`` argument for compatibility with
+        `concurrent.futures.Future` but it is an error to call it
+        before the `Future` is done, so the ``timeout`` is never used.
         """
         self._clear_tb_log()
         if self._result is not None:
@@ -215,6 +219,10 @@ class Future(object):
     def exception(self, timeout=None):
         """If the operation raised an exception, return the `Exception`
         object.  Otherwise returns None.
+
+        This method takes a ``timeout`` argument for compatibility with
+        `concurrent.futures.Future` but it is an error to call it
+        before the `Future` is done, so the ``timeout`` is never used.
         """
         self._clear_tb_log()
         if self._exc_info is not None: