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 слични објави

Пребарај: #transgenders

当前筛选 #transgenders清除筛选
Trump's Ear

@trumpsear_tg · Post #1520 · 17.09.2025 г., 16:01

In the wake of the Minneapolis Catholic church shooting, senior Justice Department officials are weighing proposals to limit transgender people’s right to possess firearms, according to two officials familiar with the internal discussions. The talks, described as preliminary in nature, appear to build on an idea that has gained some currency in conservative media since the Minneapolis shooting that killed two children and injured 21, most of them children, at Annunciation Catholic Church, an attack that police say was carried out by a 23-year-old transgender woman. Such a move would represent a dramatic escalation of the Trump administration’s fight against the rights of transgender Americans. President Donald Trump has issued a series of executive orders on the topic, including one barring transgender people from serving in the military and another ordering federal prisons to move transgender inmates to facilities corresponding to their gender assigned at birth. In addition, the idea of restricting gun rights has long been a red line for conservatives, with many Republican lawmakers and gun rights groups opposing red flag laws and or other policies aimed at keeping guns away from people suffering from mental health issues. But Justice Department leadership is seriously considering whether it can use its rulemaking authority to follow on to Trump’s determination to bar military service by transgender people and declare that people who are transgender are mentally ill and can lose their Second Amendment rights to possess firearms, according to one Justice official. Another senior Justice Department official cautioned that any such proposal, should it gain steam, would likely run into legal complications. Millions of Americans have mental health issues and many take medications, but are not a danger to society and therefore cannot have their rights infringed upon. #DOJ#transgenders#firearms 👂More on Trump's Ear ⚠️