Если запустить 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 largest tectonic plate, the Pacific Plate, moves up to 10 centimeters per year—faster than human fingernails grow. Its motion triggers earthquakes and reshapes entire coastlines. ✨
#plate⚡#tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The Himalayas are growing taller each year because the Indian plate keeps pushing into the Eurasian plate. This slow collision also makes the region one of the world’s most earthquake-prone. ✨
#plate⚡#tectonics⚡#earthquakes⚡#mountains⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Every year, thousands of tiny earthquakes ripple along Earth's mid-ocean ridges as tectonic plates slowly spread apart. These hidden quakes help shape much of the seafloor without being felt on land. ✨
#plate-tectonics ⚡#seafloor⚡#earthquakes⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Earth's crust is in constant motion due to convection currents—slow, swirling movement of hot rock deep below the surface. This drives plate movement, causing earthquakes and forming new land. ✨
#processes⚡#plate⚡#tectonics⚡#geology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍