[New-bugs-announce] [issue18699] What is Future.running() for in PEP 3148 / concurrent.futures.Future?

Guido van Rossum report at bugs.python.org
Sat Aug 10 01:48:38 CEST 2013

New submission from Guido van Rossum:

>From glyph (in a particularly snarky mood):

P.S.: I realize that this isn't really within the scope of this message, but as I was reviewing Future's documentation while writing it, I realized what Future.running() does.  Wow.  What a completely pointless bug magnet.  Why does this method even exist?  It seems like the only possible use would be to introduce look-before-you-leap bugs into concurrent code, like 'if not my_future.running(): my_future.cancel()'.  If it were for tracking the state of long-running Future operations for UI purposes or something, then 'my_future.add_start_callback(callback)' would be a much more useful interface, which at least has a hope of being used correctly.  Independently of the rest of stuff in this message, it would be great if that could be deprecated and removed.

Despite the snarkiness, he does have a point.  Perhaps it was copied mindlessly from Java?

components: Library (Lib)
messages: 194777
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: What is Future.running() for in PEP 3148 / concurrent.futures.Future?
type: enhancement
versions: Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list