Если запустить 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
#Pontida24, Matteo #Salvini (#Lega): "Processano una persona che ha fatto il suo dovere, non possono processare un intero popolo. In caso di condanna sono pronto a varcare le porte del carcere a testa alta."
@UltimoraPolitics
#Pontida24, Matteo #Salvini (#Lega) sulle nuove tasse: "Se qualcuno deve pagare qualcosa in più, paghino i banchieri e non gli operai."
@UltimoraPolitics
#Pontida24, Giancarlo #Giorgetti (#Lega): "Non sono un banchiere, sono figlio di un pescatore e di una operaia tessile. So distinguere chi fa i sacrifici e chi li può fare."
@UltimoraPolitics
Europe is in trouble. We worry about the future of our children. The bureaucrats in #Brussels are turning our lives upside down.
They support war instead of #peace.
They support #migration instead of European #families.
And they support economic sanctions instead of economic prosperity.
This has to stop. Patriots for Europe will stop it!
#Pontida24#Patriots#PfE
https://t.me/PM_ViktorOrban