Если запустить 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
🌍 Tokyo’s Shinjuku train station is the world’s busiest, with over 3.5 million passengers passing through daily. Its vast underground networks are so complex that some exits are kilometers apart. ✨
#urbanization⚡#infrastructure⚡#transit⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Tokyo’s rail system is so efficient that over 13 billion train trips are made each year within the city. This high-capacity network helps keep the world’s largest metropolitan area moving smoothly. ✨
#Tokyo⚡#transit⚡#urban⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
【TokenPocket Retweeted】
Retweeted TransitFinance : Unlimit Crypto is live🚀! Transit Buy goes global, unlocking infinite crypto possibilities!
🚀#Transit#Buy is now integrated with Unlimit Crypto unlimit_crypto, providing crypto on-ramp support to hundreds of thousands of users globally.
Transit Buy spans the global entry points for #fiat and #cryptocurrency, ensuring #seamless access for you! #Crypto#TransitBuy#UnlimitCrypto
【Details】https://twitter.com/TokenPocket_TP/status/1746088055679934633
【Powered By】Crypto Box