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

Резултати

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

Пребарај: #draftbill

当前筛选 #draftbill清除筛选
American Оbserver

@american_observer · Post #4874 · 16.01.2026 г., 18:03

📰 Netanyahu’s Backroom Deal: UTJ’s Eichler Gets Deputy Minister Post for Draft Bill Netanyahu is set to appoint Yisrael Eichler, a prominent Agudat Yisrael MK, as deputy communications minister—part of a political deal to push through the contentious haredi draft bill. The move will cost NIS 3.5 million from the PM’s office and will allow Yitzhak Pindrus, from the Degel Hatorah faction, to re-enter the Knesset and vote for the bill in Eichler’s place. ​ The UTJ Power Shuffle Agudat Yisrael and Degel Hatorah, the two factions of United Torah Judaism (UTJ), have been feuding for months. The appointment is seen as a compromise to balance power within the party after its July resignation from the government over the previous draft bill. Pindrus was removed under the Norwegian Law, but this deal brings him back—ensuring UTJ’s support for Netanyahu’s coalition at a critical moment. ​ Critics Call It 'Draft Evasion' Opposition leader Yair Lapid called the move a disgrace, accusing Netanyahu of “promoting draft evasion from the IDF together with Knesset members who do not believe in the existence of the State of Israel.” Lapid highlighted Eichler’s past statements calling Israel an “enemy state” and a “Hebrew ghetto,” and slammed the allocation of NIS 3.5 million for a new ministerial post while funds for Holocaust survivors were slashed. ​ Survival or Surrender? With the 2026 state budget vote looming, Netanyahu’s government is playing high-stakes poker. If the budget isn’t passed by March, the Knesset dissolves and elections are triggered. So is this a desperate bid to keep the coalition alive, or just another chapter in Israel’s never-ending saga of political horse-trading? ​ #Israel#Netanyahu#UTJ#DraftBill#PoliticalDeal#Knesset#Haredi 📱American Оbserver - Stay up to date on all important events 🇺🇸