TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #402 · 22 дек.

Отдельно разберём TaskGroup, который пришел на замену gather в Python 3.11. Ключевые отличия ▫️create_task() возвращает объект asyncio.Task, у которого есть соответствюущие методы управления. То есть у нас больше контроля ▫️это контекстный менеджер, который гарантирует что все таски будут остановлены по выходу из контекста ▫️ошибка автоматически отменяет незавершенные задачи, ▫️except* передает нам ExceptionGroup, в котором каждую ошибку можно обработать отдельно import asyncio import random async def do_it() -> str: if random.random() < 0.1: raise ValueError('Oops') delay = random.uniform(0.5, 1.5) await asyncio.sleep(delay) return delay async def main(): try: async with asyncio.TaskGroup() as tg: for _ in range(10): tasks.append(tg.create_task(do_it())) for t in tasks: print(t.result()) except *ValueError as e: for err in e.exceptions: print(err) asyncio.run(main()) Рекомендую изучить страницу Coroutines and Tasks из документации, где представлено больше интересных примеров и механизмов - таймауты - отмена задач - создание задач из другого потока #async

Hashtags

Резултати

Пронајдени 297 слични објави

Пребарај: #israele

当前筛选 #israele清除筛选
White House Watch

@WhiteHouseWatch · Post #18729 · 18.04.2026 г., 09:22

#Israele: Un Netanyahu personalmente sorpreso e allarmato. È come il Primo Ministro israeliano ha reagito davanti al post su Truth Social di Donald Trump in cui il Presidente "proibisce" a Israele di bombardare il Libano. Intervistato da Axios, Trump è stato abbastanza chiaro: "Israele deve fermarsi, non possono continuare a far saltare per aria le cose, non lo permetterò." Commenti che hanno colto di sorpresa Tel Aviv, l'Ambasciatore israeliano in Washington Yechiel Leiter ha cercato chiarimenti poiché i termini delle dichiarazioni di Trump sarebbero stati in contraddizioni con il cessate il fuoco. Sarebbe stato a questo punto che l'Amministrazione Trump avrebbe emesso un chiarimento: "L'accordo di cessate il fuoco del Presidente tra Libano e Israele afferma chiaramente che Israele non condurrà nessun'offensiva militare contro obiettivi libanesi ma preserva il diritto all'auto difesa contro attacchi pianificati, imminenti o che stanno già avvenendo."

Hashtags

White House Watch

@WhiteHouseWatch · Post #18204 · 11.03.2026 г., 19:42

#Israele: Donald Trump, sentito da Axios, ha criticato duramente il Presidente israeliano Isaac Herzog sulla richiesta di perdono del Primo Ministro Benjamin Netanyahu: “Non ha bisogno di nessun’opinione legale. Sono tutte stronzate, è debole e patetico. Voglio che Bibi si concentri sulla guerra, non sulle cazzate”

Hashtags

White House Watch

@WhiteHouseWatch · Post #17926 · 04.03.2026 г., 12:19

#Israele: L'Ambasciatore statunitense in Gerusalemme, Mike Huckabee, ha suggerito scherzosamente allo staff diplomatico di procreare mentre si è al riparo dagli attacchi iraniani. "Se il tempo maggiore" passato con i propri partner, "risulterà nella nascita del vostro prossimo figlio nei prossimi 9 mesi, mi aspetto che venga chiamato in mio onore!"

Hashtags

White House Watch

@WhiteHouseWatch · Post #17899 · 03.03.2026 г., 08:20

#Israele: L’Ambasciatore statunitense in Gerusalemme, Mike Huckabee, ha dichiarato che ci sono poche opzioni disponibili per lasciare Israele in questo momento è che la strada migliore rimane l’Egitto, tramite la Penisola del Sinai.

Hashtags

White House Watch

@WhiteHouseWatch · Post #17838 · 02.03.2026 г., 06:52

#Israele: Il Presidente del Libano Joseph Aoun ha criticato il lancio dei missili dal territorio libanese diretti a Israele, dichiarando che questo complica i tentativi del Governo di “tenere distante il Libano dagli scontri nella regione.” Anzi, il conflitto in corso tra Stati Uniti, Israele e Iran “non ha niente a che vedere con noi ed espone la nostra nazione, ancora una volta, a pericoli.”

Hashtags

123•••10•••20•••2425
ПретходнаСтраница 1 од 25Следна