Если запустить 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 line of longitude at 180°, known as the antimeridian, is mostly ocean but zigzags to avoid splitting island nations. This creates the International Date Line’s famous bends and detours. ✨
#coordinates⚡#longitude⚡#dateline⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The 180th meridian, a line of longitude, is opposite the Prime Meridian and mostly runs through the Pacific Ocean. It’s where calendar days officially change, creating the famous International Date Line. ✨
#coordinates⚡#longitude⚡#dateline⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Samoa’s 2011 time zone shift moved it west of the International Date Line, so travelers flying there from the U.S. now skip a day entirely, making for a calendar jump like nowhere else. ✨
#timezone⚡#dateline⚡#pacific⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The tiny country of Kiribati stretches across both sides of the International Date Line, so it can be two different calendar days at once in this island nation. ✨
#Kiribati⚡#DateLine⚡#Pacific⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Samoa famously skipped December 30, 2011, to switch from the eastern to the western side of the International Date Line. This move aligned its calendar with Australia and New Zealand. ✨
#Samoa⚡#dateline⚡#calendar⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍