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

Резултати

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

Пребарај: #gonder

当前筛选 #gonder清除筛选
Borkena

@borkena · Post #5953 · 07.03.2026 г., 19:44

በጎንደር የሀይማኖት አባቱ ተገደሉ። በአማራ ክልል፣ በጎንደር ከተማ፣ የጃሚዓል ከቢር መስጅድ ኢማም ኡስታዝ ሙሐመድ ዘይኑ ትናንት አርብ፣ የካቲት 27 ቀን 2018 ዓ.ም ከሰላት ሲመለሱ ምሽት 1:00 ጎንደር ከተማ መሐል በተተኮሰባቸው ጥይት ተገድለዋል ተብሏል። በወቅቱ አብረዋቸው በነበሩ ሌሎች 11 ሰዎች ላይ ደግሞ ድብደባ እንደተፈፀመባቸው እና ንብረታቸው እንደተዘረፈ ተገልጿል ። አካባቢው ከቅርብ ጊዜያት ወዲህ ከፍተኛ እገታና ዝርፊያ የሚፈጸምበት ሁኗል ተብሏል። ለኡስታዝ ሙሀመድ ዘይኑ ግዲያ ጥቃቱ በማን እንደተፈፀመ አልተገለፀም። ለጥቃቱ እስካሁን ሀላፊነት የወሰደ አካልም የለም። #Ethiopia#Amhara#Gonder#ethiopiannews#ዜና

Addis Standard

@addisstandardeng · Post #21865 · 27.03.2026 г., 15:38

#In_Depth_Analysis: The #Hormuz Entanglement: Why #Ethiopia’s fuel crisis is a perfect storm of #war, #graft, and #reform While the immediate catalyst appears to be the high-stakes military escalation between the U.S., Israel, and Iran, a deeper look reveals that Ethiopia’s fuel misery is a complex entanglement. It is a “perfect storm” where geopolitical vulnerability, a domestic system rotting from within, and a painful macroeconomic experiment have collided to leave 120 million people running on empty. Until the govt can clean its own house, root out the “senior decision-makers” profiting from the black market, and navigate the treacherous waters of Middle Eastern diplomacy, the accounts emerging from #Gonder to #Jimma to #Ambo, and from #Hawassa to #Bishoftu and #Mekelle, point to an Ethiopia that will remain running on empty. It will be a country “stalled at the intersection of a distant war it cannot control and a local crisis of governance it has yet to master”... https://addisstandard.com/?p=56099