This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aeros
Recipients aeros, bquinlan, gvanrossum, pitrou
Date 2020-03-02.05:54:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583128454.26.0.0546806268377.issue39645@roundup.psfhosted.org>
In-reply-to
Content
> I’m a bit disappointed, since it looks like this won’t allow implementing the OP’s classes without using private APIs. The debugging and loggin use cases aren’t very compelling to me.

Yeah, I had every intention when I initially proposed the idea on the python-ideas thread to provide an extensive means of implementing custom Future and Executor classes, but Antoine brought up a very valid concern about users shooting themselves in the foot with it:

> I'm much more lukewarm on set_state().  How hard is it to reimplement
> one's own Future if someone wants a different implementation?  By
> allowing people to change the future's internal state, we're also
> giving them a (small) gun to shoot themselves with.

In terms of a cost-benefit analysis, I'd imagine that it's going to be a rather small portion of the concurrent.futures users that would actually have a genuine use case for implementing their own custom Future or Executor. 

He was still approving of a `future.state()` though, which is why I considered implementing it alone:

> That sounds useful to me indeed.  I assume you mean something like a
> state() method?  We already have Queue.qsize() which works a bit like
> this (unlocked and advisory).

Although not nearly as significant (or interesting), I've personally encountered situations where it would be useful for logging purposes to be able to read the approximate state of the future. But if the consensus ends up being that it's not useful enough to justify adding compared to the original purpose of the issue, I would certainly understand.
History
Date User Action Args
2020-03-02 05:54:14aerossetrecipients: + aeros, gvanrossum, bquinlan, pitrou
2020-03-02 05:54:14aerossetmessageid: <1583128454.26.0.0546806268377.issue39645@roundup.psfhosted.org>
2020-03-02 05:54:14aeroslinkissue39645 messages
2020-03-02 05:54:13aeroscreate