Если запустить 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
🇺🇸#USA – Si sono tenute in #Texas e #NordCarolina le primarie per le elezioni di metà mandato. Per il seggio al Senato in Texas, tra i dem ha vinto James #Talarico, seminarista presbiteriano noto per la sua comunicazione che unisce progressisti e moderati, battendo la liberal afroamericana Jasmine #Crockett. Talarico sfiderà il vincitore delle primarie repubblicane, molto combattute, tra il senatore John #Cornyn e il procuratore generale del Texas Ken #Paxton.
@UltimoraPolitics24
🚨🇺🇸CORNYN DOMINATES TEXAS PRIMARY, PAXTON STUMBLES🤠
A massive political earthquake in the Lone Star State as Establishment GOP strikes back! 🐘⚡
🔹Cornyn Crushes It: Sen. John Cornyn outperforms all expectations, securing a commanding lead despite attacks from the far-right. A huge win for Mitch McConnell's wing! 🏛️💪
🔹Paxton in Peril: Attorney General Ken Paxton, plagued by legal scandals & impeachment battles, is now fighting for his political life in a grueling runoff. The "America First" warrior is on the ropes! 🥊📉
🔹GOP Civil War: This primary exposes the deep rift between traditional Republicans and the MAGA insurgent wing in Texas. It's getting UGLY. 🩸🇺🇸
The runoff will be brutal. Can Paxton survive without Trump's full force? Or is Cornyn's victory a sign that the GOP is shifting? 🔄🔥
Texas politics is a bloodsport—grab your popcorn! 🍿👇
#USNews#Texas#politics#GOP#election#Cornyn#Paxton#CivilWar