Message221994
| Author |
vstinner |
| Recipients |
ryder.lewis, vstinner |
| Date |
2014年06月30日.23:33:08 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1404171188.46.0.273164476929.issue21886@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I see two options to fix this issue:
- add an optional parameter to set_result() to do nothing if the future is cancelled
- add a method (public or private) to set a result or do nothing if the future is cancelled
Patch "Add ignore_cancelled and ignore_done to Future.set_result()" (for Tulip):
http://codereview.appspot.com/109340043
Patch "Add Future._maybe_set_result()":
http://codereview.appspot.com/108300043
I prefer the second patch because it doesn't touch the public API and it is shorter.
Note: the first patch contains unrelated changes, like checking fut.cancelled() instead of fut.done().
"_maybe_set_result()" is not a good name. Other suggestions: "_set_result_except_cancelled", ""_set_result_ignore_cancelled". |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年06月30日 23:33:08 | vstinner | set | recipients:
+ vstinner, ryder.lewis |
| 2014年06月30日 23:33:08 | vstinner | set | messageid: <1404171188.46.0.273164476929.issue21886@psf.upfronthosting.co.za> |
| 2014年06月30日 23:33:08 | vstinner | link | issue21886 messages |
| 2014年06月30日 23:33:08 | vstinner | create |
|