(Python 3.5) Asyncio and an attempt to run loop.run_until_complete() from within a running loop

2016-04-08 Thread Alexander Myodov
Hello. TLDR: how can I use something like loop.run_until_complete(coro), to execute a coroutine synchronously, while the loop is already running? More on this: I was trying to create an aio_map(coro, iterable) function (which would asynchronously launch a coroutine for each iteration over iter

Re[2]: RIIA in Python 2.5 alpha: "with... as"

2006-04-11 Thread Alexander Myodov
Hello Duncan, You wrote: > Alexander Myodov wrote: >> So, with 2.5, I tried to utilize "with...as" construct for this, but >> unsuccessfully: >> ... >> So, does this mean that we still don't have any kind of RIIA in >> Python, any capability to

RIIA in Python 2.5 alpha: "with... as"

2006-04-11 Thread Alexander Myodov
Hello, Having heard that Python 2.5 offers some kind of RIIA concept via PEP343, got it downloaded (Windows version) and tried. But it did not work as expected and as wanted. For the time since I first learned Python, the only reason why I just could not use it was inability to localize the lifeti