[Python-Dev] async/await behavior on multiple calls

2015-12-15 Thread Roy Williams
Howdy, I'm experimenting with async/await in Python 3, and one very surprising behavior has been what happens when calling `await` twice on an Awaitable. In C#, Hack/HHVM, and the new async/await spec in Ecmascript 7. In Python, calling `await` multiple times results in all future results getting

Re: [Python-Dev] async/await behavior on multiple calls

2015-12-15 Thread Roy Williams
ow that it wasn't already awaited" makes me sound that you're just > using it in an atypical way (perhaps because your model is based on other > languages). In typical asyncio code, one does not usually take an > awaitable, wait for it, and then return it -- one either awaits it

Re: [Python-Dev] async/await behavior on multiple calls

2015-12-15 Thread Roy Williams
@Kevin correct, that's the point I'd like to discuss. Most other mainstream languages that implements async/await expose the programming model with Tasks/Futures/Promises as opposed to coroutines PEP 492 states 'Objects with __await__ method are called Future-like objects in the rest of this PEP.

Re: [Python-Dev] async/await behavior on multiple calls

2015-12-16 Thread Roy Williams
vanov wrote: > Roy, > > On 2015-12-15 8:29 PM, Roy Williams wrote: > [..] > >> >> My proposal would be to automatically wrap the return value from an >> `async` function or any object implementing `__await__` in a future with >> `asyncio.ensure_future()`. Th

[Python-Dev] Expose environment variable for Py_Py3kWarningFlag (Issue 28288)

2016-11-23 Thread Roy Williams
Howdy all, I'd love to be able to get http://bugs.python.org/issue28288 into 2.7.12 . I've found the -3 flag to be immensely useful when porting Python code to Python 3, but unfortunately it can be difficult to use with services that run python in subprocesses (like Gunicorn or Xdist with py.test)