Если запустить REPL с модулем asyncio, то вы входите в особый асинхронный REPL.
user@host:~$ python -m asyncio
asyncio REPL 3.12.7 ...
Use "await" directly instead of "asyncio.run()".
>>> import asyncio
>>>
В этом режиме
- создаётся и настраивается event loop
- уже импортирован asyncio
- работает await на верхнем уровне
То есть такая команда сработает без ошибок!
await asyncio.sleep(3)
Удобно для тестирования асинхронных функций без создания ивентлупов и остальной обвязки.
Работает в: 3.8+
#tricks#async
🌍 The world’s largest atoll by land area is Kwajalein in the Marshall Islands. Its ring-shaped coral formation encloses a lagoon larger than most inland lakes and supports unique marine life. ✨
#coralreef⚡#lagoon⚡#biodiversity⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
Be soft. Do not let the world make you hard. Do not let pain make you hate. Do not let the bitterness steal your sweetness. Take pride that even though the rest of the world may disagree, you still believe it to be a beautiful place..🤍
Video/Photo Créateur @konstantin.rivera 🤍
MUAH @richy_yuliana🕊
Style @olgasheremeta🦢
#chakras#mantra#mantramonday#gipsy#balance#levitation#purelove#heavenonearth#hooponopono#petitefemme#mira#moodoftheday#video#lagoon