Если запустить 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 tiny Etruscan shrew weighs less than a coin and eats up to twice its body weight daily. Its fast metabolism keeps this mini mammal constantly hunting for insects. ✨
#mammals⚡#shrews⚡#metabolism
👉subscribe Interesting Planet
🌎 Some hummingbirds have the fastest metabolism of any warm-blooded animal, with heart rates reaching over 1,200 beats per minute during flight. These tiny birds must eat constantly to fuel their high-energy lifestyle, sipping nectar from hundreds of flowers every day. ✨
#hummingbird⚡#metabolism⚡#nature
👉subscribe Interesting Planet
The idea that skinny people have fast metabolisms is a myth. Metabolism depends largely on muscle mass—more muscle means higher energy use. Skinny people usually have less muscle, so their metabolism is often slower. Weight and appearance don’t reliably show metabolism speed.
[Read more]
@googlefactss
#Metabolism#MythBusted#Health#Fitness#BodyScience