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:05:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583125541.61.0.873140147602.issue39645@roundup.psfhosted.org>
In-reply-to
Content
> This leaves just future.state() and having the states as publicly accessible module-level constants.

After reading over the python-ideas again and having some time to reflect, I think we can start with just adding future.state(), as that had the most value. Since future.state() is primarily intended for debugging/informational purposes as an approximation (similar to `queue.qsize()`) rather than something to be consistently relied upon, I don't see a strong practical use case for returning the states as enums (instead of a string).

If we consider adding a means to directly modify the state of the future in the future or providing an option to safely read the state of the future (through its RLock) later down the road, it may be worth considering. But not at the moment, IMO.

I'll update the name of the issue accordingly, and should have time to open a PR in the next few days. It should be rather straightforward, with the main emphasis being on the documentation to ensure that it clearly communicates the purpose of future.state(); so that users don't assume it's anything more than an approximation.
History
Date User Action Args
2020-03-02 05:05:41aerossetrecipients: + aeros, gvanrossum, bquinlan, pitrou
2020-03-02 05:05:41aerossetmessageid: <1583125541.61.0.873140147602.issue39645@roundup.psfhosted.org>
2020-03-02 05:05:41aeroslinkissue39645 messages
2020-03-02 05:05:40aeroscreate