Если запустить 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
🎯🚀#ABG began as a small idea fueled by big dreams. With a clear mission, a dedicated team, and strong community support, the project continues to grow with purpose. While we’re still in the development phase, our focus remains on building real solutions to real problems. We’re confident that, with persistence and collective effort, $ABG will evolve into a thriving ecosystem and achieve lasting success. The journey is ongoing, our commitment is unwavering. 🔥🔥
🔥https://x.com/abitcoingold/status/1924388768058130544