Re: [python-tulip] closing event loops

2014-09-09 Thread Martin Teichmann
Hi Guido, Hi List, for t in asyncio.Task.all_tasks(loop): t.cancel() loop.run_until_complete(asyncio.sleep(0.1)) # Give them a little time to recover loop.close() That solves my problem. Couln't we write def cancel(self): on top of it and put it into BaseEventLoop? In this case we

Re: [python-tulip] closing event loops

2014-09-09 Thread Guido van Rossum
On Tue, Sep 9, 2014 at 12:53 AM, Martin Teichmann martin.teichm...@gmail.com wrote: Hi Guido, Hi List, for t in asyncio.Task.all_tasks(loop): t.cancel() loop.run_until_complete(asyncio.sleep(0.1)) # Give them a little time to recover loop.close() That solves my problem. Couln't

Re: [python-tulip] closing event loops

2014-09-09 Thread Guido van Rossum
On Tue, Sep 9, 2014 at 11:12 AM, Martin Teichmann martin.teichm...@gmail.com wrote: Hi Guido, Hi List, And yet having a try/finally around a yield-from is an easy recipe for resisting cancellation -- it is all too convenient to put another yield-from in the finally clause, and then you are

Re: [python-tulip] Trololio: Trollius compatibility made easy

2014-09-09 Thread Think Kos
(I'll spare you my fanboy banter) Thanks :) Not exactly, maybe I should have been more explicit about my intent with this module, because it allows using yield From(x) and raise Return with asyncio, programs can have a *soft* dependency on trollius in Python 3.4+. Which is a good thing,