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

Резултати

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

Пребарај: #protecttranskids

当前筛选 #protecttranskids清除筛选
BadVolf

@BadvolfNews · Post #885 · 23.09.2023 г., 16:19

🚨BREAKING NEWS🚨 🔍 California Gov. Gavin Newsom, a Democrat, vetoes bill requiring judges to consider parental affirmation of child's gender identity in custody cases. 👨‍⚖️ 💔 Despite claims of being an LGBTQ+ ally, Newsom's move sparks outrage among activists and lawmakers. 😡 📜 The bill, AB 957, aimed to protect transgender kids in family court and ensure their mental well-being. 🏳️‍⚧️ 🗣️ Assemblywoman Lori Wilson, coauthor of the bill, expresses disappointment and vows to continue fighting for trans kids' rights. 💪 💔 California's failure to stand with these vulnerable children is a tragedy, says Senator Scott Wiener. 😔 ❌ Newsom's veto perpetuates fear and discrimination against trans kids, warns Wiener. It's time for CA to act! 💔🏳️‍⚧️ 🔥 Let's demand justice and support for our TGI children! Their futures depend on it. 🌈 📲 Stay tuned for more updates on the fight for equality and justice! #TransRightsMatter#ProtectTransKids💙💖🤍 https://dcweekly.org/2023/09/23/california-governor-vetoes-bill-on-gender-identity-in-child-custody-cases/ Subscribe to @BadVolfNews

Social Justice Watch

@social_justice_watch · Post #17272 · 25.09.2022 г., 01:11

There are infinite ways to be trans. Try not to feel discouraged if your experiences are different from other trans people you know. Your journey is uniquely yours. - [IMAGE DESCRIPTION: A tweet by @im_just_laur that says, "If you see 'trans culture' & just can't connect with it, remember that most of not all mainstream trans culture is made by & for a bunch of white trans people early in their transition. It's not inherent to transness. It's not something you have to relate to to be trans." The background photo is a pink sunset on a beach. The remaining text is too long to fit in the caption but can be found in the comments below or by using the alt text feature.] - #trans#transgender#ftm#mtf#nonbinary#gender#genderqueer#queer#lgbt#lgbtq#pride#transgirl#transboy#transwoman#transguy#transman#protecttransyouth#protecttranskids#transjoy https://www.instagram.com/p/Cic3zpPLbMf/