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

TGINSIGHT SIMILAR POSTS

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

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

Функция asyncio.wait() это еще один способ вызвать множество асинхронных задач. Она работает в нескольких режимах. 1. Самый простой - ждем завершения всех задач async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(10)] done, pending = await asyncio.wait( tasks, return_when=asyncio.ALL_COMPLETED ) for task in done: try: print(task.result()) except Exception as e: print(e) Очень похоже на gather, но работает не так. ▫️возвращает не результаты, а два сета с объектами Task у которых можно забрать результат через task.result() если они в списке done ▫️не гарантирует порядок результатов так как оба объекта это set ▫️не выбрасывает исключение когда оно появляется, а сохраняет его в Task. Исключение появится когда попробуете забрать резултьтат. 2. Ждем завершения первой задачи, даже если там ошибка. async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(3)] done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED ) # в done может быть несколько задач! for task in done: try: print(task.result()) except Exception as e: print(f"Fail: {e}") # Оставшиеся задачи в pending, как правило, нужно отменить, иначе они будут продолжать работать for task in pending: task.cancel() В сете done будут таски которые успели завершится, причем как успешно так и нет. 3. До первой ошибки. Тоже самое, но с аргументом FIRST_EXCEPTION done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_EXCEPTION ) Функция завершается как только первая задача упадет с ошибкой. Учтите, что в любом случае done вы можете обранужить несколько задач, как с ошибками так и успешные. ↗️ Полный листинг примеров здесь #async

Hashtags

Резултати

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

Пребарај: #simret

当前筛选 #simret清除筛选
Borkena

@borkena · Post #5509 · 10.12.2025 г., 05:31

Democratic Simret Tigray Gets Official Recognition From Electoral Board. Read more. https://borkena.com/2025/12/10/ethiopia-democratic-simret-tigray-gets-official-recognition-from-electoral-board/#Ethiopia#news#Simret

Addis Standard

@addisstandardeng · Post #21503 · 23.02.2026 г., 14:11

News update: #Tigray Democratic Solidarity rejects HoF decision, threatens to boycott elections and similar ‘illegal acts’ if unresolved Tigray Democratic Solidarity (#Simret) has called on the House of #Federation (HoF) to reconsider its decision to remove electoral constituencies in districts previously under the Tigray region administration, describing the move as “unconstitutional” and warning that it undermines Ethiopia’s federal system. In a letter addressed to both the House of Federation and the National Election Board of Ethiopia (#NEBE), Simret said the decision constitutes an act that “undermines the country’s constitutional order, crushes institutional independence, and effectively declares ‘constitutional anarchy’.” Citing Article 62 of the FDRE Constitution, the party argued that the House of Federation’s powers are limited to constitutional interpretation & the resolution of regional boundary disputes. Simret further argued that boundary... Read more: https://addisstandard.com/?p=55350

Addis Standard

@addisstandardeng · Post #21681 · 11.03.2026 г., 15:03

News: Simret withdraws lawsuit challenging #NEBE decision on five #Tigray constituencies; Getachew Reda says dispute requires political resolution The Tigray Democratic Solidarity (#Simret) party has withdrawn its lawsuit challenging a decision by the National Election Board of #Ethiopia (NEBE) concerning five electoral constituencies in Tigray, party leader #Getachew_Reda confirmed to Addis Standard today. Getachew, who is also Advisor to the Ethiopian Pm, said the party submitted a formal request to the Federal High Court seeking to discontinue the case, arguing that documents presented during earlier proceedings showed that what had been described as a decision of the House of Federation did not constitute a formal institutional ruling made through constitutional procedures. According to him, the document produced in court indicated that the matter reflected the position of officials rather than a decision adopted through the House’s legally required…… Read more: https://addisstandard.com/?p=55753