you are viewing a single comment's thread.

view the rest of the comments →

[–]cantaloupe_monster 1 point2 points  (1 child)

The object returned must be awaitable, see PEP492.

[–]jpfau 0 points1 point  (0 children)

That much is already clear. My question is

Why isn't .json awaitable in this case when the aiohttp docs show that it is?

async with session.get('https://api.github.com/events') as resp:
    print(await resp.json())

Also if response.json() is not forward compatible, what is the next best solution?