[python-tulip] asyncio.async versus loop.create_task

2015-03-22 Thread Luciano Ramalho
I understand these do almost the same thing, and asyncio.async can even get a loop keyword argument so it's as flexible as loop.create_task, which it uses internally. So my question is: are both being kept going forward, or is this redundancy just a temporary compatibility measure before

Re: [python-tulip] asyncio.async versus loop.create_task

2015-03-22 Thread Guido van Rossum
They're totally different. async() is for those cases where you have something that's either a coroutine or a Future and what you need is a Future (e.g. because you want to add a callback). It will return the Future unchanged but wrap the coroutine in a Task. (Note that Task subclasses Future so a