Если запустить 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
🌎 Golden poison dart frogs from Colombia are among the world’s most dangerous animals. Their skin holds enough potent toxin to kill up to 10 adults. The toxin, called batrachotoxin, blocks nerve signals to muscles, causing paralysis and death even in small doses. ✨
#animals⚡#toxins⚡#Colombia
👉subscribe Interesting Planet
👉more Channels
🌎 The rainbow mantella frog of Madagascar sports neon green and orange skin, warning predators of its toxicity. These tiny amphibians gain their deadly defenses from eating certain ants and mites in the wild. ✨
#amphibians⚡#Madagascar⚡#toxins
👉subscribe Interesting Planet
That "new car smell" is a toxic chemical cocktail! ☠️
You're breathing VOCs from plastics, foam, and adhesives—including formaldehyde. It's essentially off-gassing from your car's interior.
Carmakers are now phasing it out for health reasons.
[Read more]
@googlefactss#NewCarSmell#Toxins#HealthWarning#CarFacts