Fix Python – asyncio.ensure_future vs. BaseEventLoop.create_task vs. simple coroutine?

I’ve seen several basic Python 3.5 tutorials on asyncio doing the same operation in various flavours.
In this code:
import asyncio

async def doit(i):
print(“Start %d” % i)
await asyncio.sleep(3)
print(“End %d” % i)
return i

if __name__ == ‘__main__’:
loop = asyncio.get_event_loop()
#futures = [asyncio.ensure_future(doit….

Fix Python – Equivalent C++ to Python generator pattern

I’ve got some example Python code that I need to mimic in C++. I do not require any specific solution (such as co-routine based yield solutions, although they would be acceptable answers as well), I simply need to reproduce the semantics in some manner.
This is a basic sequence generator, clearly too large to store a materialized version.

Fix Python – Greenlet Vs. Threads

I am new to gevents and greenlets. I found some good documentation on how to work with them, but none gave me justification on how and when I should use greenlets!

What are they really good at?
Is it a good idea to use them in a proxy server or not?
Why not threads?

What I am not sure about is how they can provide us with concurrency if they’re ….