bpo-33649: Fix asyncio-dev (GH-9324)
diff --git a/Doc/library/asyncio-future.rst b/Doc/library/asyncio-future.rst
index ff04339..19bf8a6 100644
--- a/Doc/library/asyncio-future.rst
+++ b/Doc/library/asyncio-future.rst
@@ -121,6 +121,16 @@
or an exception set with :meth:`set_result` or
:meth:`set_exception` calls.
+ .. method:: cancelled()
+
+ Return ``True`` if the Future was *cancelled*.
+
+ The method is usually used to check if a Future is not
+ *cancelled* before setting a result or an exception for it::
+
+ if not fut.cancelled():
+ fut.set_result(42)
+
.. method:: add_done_callback(callback, *, context=None)
Add a callback to be run when the Future is *done*.
@@ -180,10 +190,6 @@
.. versionadded:: 3.7
- .. method:: cancelled()
-
- Return ``True`` if the Future was *cancelled*.
-
This example creates a Future object, creates and schedules an
asynchronous Task to set result for the Future, and waits until