Если запустить 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
🌍 Some biodiversity hotspots, like the Cape Floristic Region in South Africa, pack over 9,000 plant species into just a tiny area—nearly 70% found nowhere else on Earth. ✨
#biodiversity⚡#plants⚡#hotspots⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Sundaland region in Southeast Asia is a biodiversity hotspot where over 15,000 plant species are found, nearly half of which exist nowhere else on Earth. ✨
#biodiversity⚡#hotspots⚡#conservation⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Western Ghats in India hold more amphibian species than all of Europe, packed into a narrow mountain strip. This biodiversity hotspot shelters ancient frogs found nowhere else on Earth. ✨
#biodiversity⚡#hotspots⚡#amphibians⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 New species are still being discovered in biodiversity hotspots like the Eastern Himalayas, where over 350 new plants and animals have been found in just two decades. ✨
#hotspots⚡#species⚡#discovery⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels