#!/usr/bin/env python """ When PYTHONASYNCIODEBUG is set to 1, this causes a strange error: TypeError: send() takes 2 positional arguments but 7 were given Invoke as follows: $ PYTHONASYNCIODEBUG=1 python3 put_get_bug.py Note that os.environ["PYTHONASYNCIODEBUG"] = "1" doesn't work. """ import asyncio import os def t1(q): yield from asyncio.sleep(0.5) q.put_nowait((0, 1, 2, 3, 4, 5)) def t2(q): v = yield from q.get() print(v) q = asyncio.Queue() asyncio.get_event_loop().run_until_complete(asyncio.wait([t1(q), t2(q)]))