You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 31, 2021. It is now read-only.
async with aiohttp.ClientSession() as session:
...
Also please be consistent: either pass loop everywhere (aiohttp.Timeout(5, loop=loop), asyncio.gather(*tasks, loop=loop)) or don't pass it at all.
For first case calling asyncio.set_event_loop(None) at very begin of the program effectively checks that loop is passed to any call where it's required.
The text was updated successfully, but these errors were encountered:
Sure, but the question is: do you prefer explicit loop or not?
In all my code I pass loop explicitly because I've found it as best practice for writing safe code and avoiding stupid mistakes.
On other hand it may be too complex for beginners.
E.g. instead of
Use
Also please be consistent: either pass loop everywhere (
aiohttp.Timeout(5, loop=loop)
,asyncio.gather(*tasks, loop=loop)
) or don't pass it at all.For first case calling
asyncio.set_event_loop(None)
at very begin of the program effectively checks that loop is passed to any call where it's required.The text was updated successfully, but these errors were encountered: