Если запустить 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
⚠️ A whale who supplied 56,995 $WETH ($90.8M) to borrow $DAI on #Maker is on the verge of liquidation, with a liquidation price of $1,564.58.
Earlier today, another giant whale was already liquidated for 67,569 $ETH ($106M) at $1,650 to repay a $74.49M loan as the price plunged!
In the past 24 hours, $898M, mostly from long positions, was liquidated from the cryptocurrency market.
Follow @spotonchain for more insights at https://x.com/spotonchain/status/1909075294834848057