[Python-Dev] iscoroutinefunction vs. coroutines

2017-03-09 Thread Matthias Urlichs
mentations. -- -- Matthias Urlichs signature.asc Description: Digital signature ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/arch

Re: [Python-Dev] asyncio: how to interrupt an async def w/ finally: ( e.g. Condition.wait() )

2015-12-19 Thread Matthias Urlichs
future(cond.wait()) await asyncio.wait([w],timeout=1) print(gc.get_referrers(w)) loop.run_until_complete(main()) Time to refactor my code to do the wait/timeout outside the "async with cond". -- -- Matthias Urlichs _

Re: [Python-Dev] asyncio: how to interrupt an async def w/ finally: ( e.g. Condition.wait() )

2015-12-19 Thread Matthias Urlichs
refcount reaches zero without completing simply goes away; finally: blocks are *not* called and there is *no* warning. I consider that to be a bug. -- -- Matthias Urlichs ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailma

[Python-Dev] asyncio: how to interrupt an async def w/ finally: ( e.g. Condition.wait() )

2015-12-19 Thread Matthias Urlichs
The following code has a problem: the generator returned by .wait() has a finally: section. When self.stopped is set, it still needs to run. As it is asynchronous (it needs to re-acquire the lock), I need to come up with a reliable way to wait for it. If I don't, .release() will throw an excepti