Если запустить 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
🌳 Hidden Forest & Monkey Kingdom near Durban 🐵
Explore the Hidden Forest Sanctuary in Ballito, where primates roam free in a lush natural haven! Just 40 km (25 mi) north of Durban in KwaZulu-Natal, this gem opened in 2019 and is a must-visit for wildlife lovers.
📍 Ballito, South Africa
🎥 Video: https://www.youtube.com/watch?v=Nfo7xp5YtBE&list=PL6fK0Yu-8iyQTFxtSn5GlKM65_ACMniU3&index=1
#Nature#Monkeys#Travel#SouthAfrica
🌎 In the lush forests of Borneo, the proboscis monkey sports a huge, pendulous nose. This unique feature helps males amplify their calls and attract mates, making it one of nature’s most unusual adaptations for communication. ✨
#borneo⚡#monkeys⚡#evolution
👉subscribe Interesting Planet