<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Yeah, it would be better to use the chain_future call from async directly, but the problems are 1) it would make concurrent dependent on async and 2) if it were public, it would require users to instantiate futures, which they’re not supposed to do.<div><br></div><div>-dancollins34<br><br><div id="AppleMailSignature">Sent from my iPhone</div><div><br>On Jan 26, 2018, at 3:16 AM, Bar Harel <<a href="mailto:bzvi7919@gmail.com">bzvi7919@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><p dir="ltr">I have a simple way to solve this I believe.</p>
<p dir="ltr">Why not just expose "_chain_future()" from asyncio/futures.py to the public, instead of copying and pasting parts of it?</p>
<p dir="ltr">It already works, being used everywhere in the stdlib, it supports both asyncio and concurrent.futures, it's an easily testable external function (follows the design of asyncio for the better part), it's threadsafe right out of the box and it wouldn't require anything but removing a single underscore and adding documentation. (I always wondered why was it private anyway)</p>
<p dir="ltr">It's like the function was meant to be public :-P</p>
<p dir="ltr">-- Bar</p>
<br><div class="gmail_quote"><div dir="ltr">On Fri, Jan 26, 2018, 8:07 AM Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I really don't want to distract Yury with this. Let's consider this (or something that addresses the same need) for 3.8.<br><br>To be clear this is meant as a feature for concurrent.futures.Future, not for asyncio.Future. (It's a bit confusing since you also change asyncio.)<br><br>Also to be honest I don't understand the use case *or* the semantics very well. You have some explaining to do...<br><br></div>(Also, full links: <a href="https://bugs.python.org/issue32672" target="_blank">https://bugs.python.org/issue32672</a>; <a href="https://github.com/python/cpython/pull/5335" target="_blank">https://github.com/python/cpython/pull/5335</a>)<br></div><div class="gmail_extra"></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 25, 2018 at 8:38 PM, Daniel Collins <span dir="ltr"><<a href="mailto:dancollins34@gmail.com" target="_blank">dancollins34@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Hello all,<div><br></div><div>So, first time posting here. I’ve been bothered for a while about the lack of the ability to chain futures in python, such that the next future will execute upon the first’s completion.  So I submitted a pr to do this.  This would add the .then(self, fn) method to concurrent.futures.Future.  Thoughts?</div><div><br></div><div>-dancollins34</div><div><br></div><div>Github PR #5335</div><div><a href="http://bugs.python.org" target="_blank">bugs.python.org</a> issue #32672</div></div><br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
<br></blockquote></div><br><br clear="all"><br></div><div class="gmail_extra">-- <br><div class="m_-3449906085406200997gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote></div>
</div></blockquote></div></body></html>