From 76d3ab1bfc6047721af0d853ea655604643cb57f Mon Sep 17 00:00:00 2001 From: Chuanjun Yin Date: Fri, 31 Jul 2026 01:07:29 +0800 Subject: [PATCH] Clarify Future.cancel() behavior --- Doc/library/concurrent.futures.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst index cadf841b43537e..7948b1d4920dfd 100644 --- a/Doc/library/concurrent.futures.rst +++ b/Doc/library/concurrent.futures.rst @@ -504,10 +504,9 @@ The :class:`Future` class encapsulates the asynchronous execution of a callable. .. method:: cancel() - Attempt to cancel the call. If the call is currently being executed or - finished running and cannot be cancelled then the method will return - ``False``, otherwise the call will be cancelled and the method will - return ``True``. + Attempt to cancel the call. Return ``False`` if the call cannot be + cancelled because it is already running or has finished. Otherwise, cancel + the call and return ``True``. .. method:: cancelled()