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

Резултати

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

Пребарај: #amharic

当前筛选 #amharic清除筛选
Borkena

@borkena · Post #5268 · 16.11.2025 г., 18:47

Media, Translation, and Historical Accountability: The Case of the “Wax-and-Cloth Burning” Narrative in Key Anbessa (2025). Read more. https://borkena.com/2025/11/14/ethiopia-media-translation-and-historical-accountability-the-case-of-the-wax-and-cloth-burning-narrative-in-key-anbessa-2025/#Ethiopia#News#Amharic

Borkena

@borkena · Post #6044 · 18.03.2026 г., 15:20

25 የኢትዮጵያ ባንኮች የመፍረስ አደጋ ተጋርጦባቸዋል ፤ በደሴ ከተማ ለተሽከርካሪዎች የተላለው የሰዐት እላፊ እና ሌሎች ዜናዎች፡፡ ሙሉውን ከቻናላችን ያድምጡ፡፡ https://youtu.be/7C295S7INDs#Ethiopia#News#Amharic#Banks#NationalBank#EthiopianNews#ዜና

Borkena

@borkena · Post #6191 · 21.04.2026 г., 13:07

በሲቪል ሰርቪስ ከ150 በላይ የሀሰተኛ የትምርህርት ማስረጃ ተገኘ መባሉ ፤ በመንግስት ደጋፊነት የሚተቸው አብን መዋቅራዊ በደል ድርሷል ማለቱ እና ሌሎች ዜናዎች ፡፡ https://youtu.be/y4-9eSmywW8#Ethiopia#News#Amharic#EthiopianNews#fakecredential#education#NAMA

Addis Standard

@addisstandardeng · Post #21665 · 10.03.2026 г., 10:03

News: #Google Expands AI Search to 13 #African Languages, Including #Ethiopia’s Afaan Oromoo, Amharic, and Somali Google has expanded its artificial intelligence–powered search tools to support 13 African languages, including Ethiopian languages #Afaan_Oromoo, #Amharic, and #Somali, in a move aimed at widening access to digital services across the continent. The update introduces local language support for Google’s #AI search features, enabling users to interact with the platform using text, voice, or images in their preferred languages. The company said the expansion is intended to make AI tools more accessible to millions of African users who rely on local languages for everyday communication. In addition to Afaan Oromoo, Amharic, and Somali, the newly supported languages include Afrikaans, Akan, Hausa, Kinyarwanda, Kiswahili, Sesotho, Setswana, Wolof, Yorùbá, and isiZulu. Google...... https://web.facebook.com/AddisstandardEng/posts/pfbid0ZJge8GLSFrAuxUkYUJm28Q53sUEEFUKEM9bXhKBFhuZPueaGkzDN6p2vv5Bv1J2Bl