Если запустить 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
Live: Get your virtual panda cuddles from Chongqing Zoo!
It's Saturday! Time for some super cute pandas. Yu Ai, Yu Ke, Mang Cancan, Qi Sanmei and Liang Yue in Chongqing Zoo get ready for clumsy rolls, silly play and fluffy cuteness. Join us to have a look! #panda
via CGTN
🩸🅰️🩸🩸🅰️
A Chinese zoo is under fire again for passing off dogs as pandas. This is the third time that people have been tricked by painting ordinary chow chows as pandas.
Visitors began to suspect that they weren't pandas when the spotted furry creatures started barking and panting like dogs.
The plan was perfect. What could go wrong?
#Panda#China
MARKHEMIST