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

Резултати

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

Пребарај: #menelikii

当前筛选 #menelikii清除筛选

⚔️ **THE BATTLE OF ADWA: AFRICA'S GREATEST VICTORY** ⚔️ **THE BATTLE OF ADWA: AFR 🏛️ March 1, 1896 - The day that changed African history forever! Emperor Menelik II led 100,000 Ethiopian warriors against 20,000 Italian colonial forces at Adwa. 👑ed 100,000 Ethiopian warri• Emperor Menelik II united all Ethiopian tribes • Empress Taytu Betul - strategic military advisor • Modern weapons acquired from European rivals ⚔️peror Menelik II led 1• 70% of Italian forces killed, wounded or captured • First African victory over European colonial power • Italy forced to recognize Ethiopian independence 🌍elik II led 100,000• Inspired anti-colonial movements worldwide • Pan-African pride and resistance symbol • Proved African military capability to the world ✊forever! Emperor Men• Ethiopia remained uncolonized • Victory celebrated across Africa and diaspora • March 1st - Victory Day in Ethiopia 🌟 When Africa stood up and said "NO" to colonialism! በአድዋ አፍሪካ ለቅኝ ግዛት "አይ" አለች! 🇪🇹 #Ethiopia#ኢትዮጵያ#BattleOfAdwa#MenelikII#AfricanPride#Anticolonial

Red Nile

@rednile12 · Post #11124 · 01.03.2026 г., 15:25

🇪🇹Adwa at 130: A Victory That Shaped a Continent By: Alexander Yoh. / @rednile12 On March 1, 1896, Ethiopia achieved the impossible—defeating Italy and sending shockwaves through colonial powers. Adwa wasn’t just a battle; it was a statement: Africa can defend its sovereignty. Today, Adwa’s legacy is a blueprint for the future—unity across diversity, strategic independence, and self-reliance. From Menelik II’s brilliant leadership to Ethiopia’s modern projects like the Grand Renaissance Dam, the message is clear: our strength is in standing together and shaping our destiny. 📖 Read the full story here: Adwa’s 130-Year Legacy #የጥቁር_ህዝብ_ኩራት#ዓድዋ_130 #የኢትዮጵያውያን_ድል#Adwa130#EthiopianPride#AfricanUnity#Sovereignty#MenelikII#TaytuBetul#RedNileMedia#AfricanResilience#AdwaLegacy#SelfReliance