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

Резултати

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

Пребарај: #buidler

当前筛选 #buidler清除筛选
Arweave Announcements

@arweaveannouncements · Post #124 · 26.09.2019 г., 14:55

Our latest community spotlight is here! 🛠️🚀 This week we meet Almaz: Chemical engineering student, all-round creative thinker, and #buidler of WeaveWatcher and Arweave.Design 📢😎http://bit.ly/MeetAlmaz

Hashtags

Buidlpad

@native_fi · Post #136 · 16.12.2025 г., 06:29

Introducing the Buidl Contributor role 🤍 This role is for community members who actively help Buidlpad grow through community participation, support, boosts and engagement. Contribute consistently to unlock future role-based rewards! Join the Buidlpad Discord Community → http://discord.gg/buidlpad ▫️What is the Buidl Contributor Role? Buidl Contributor is the next role in our series of Community Role Launches This role recognizes users who actively support the Buidlpad community by contributing time, effort & presence. It focuses on community participation & engagement, not capital. ▫️How to Get the Buidl Contributor Role? 🔹 Join the Buidlpad Discord: http://discord.gg/buidlpad 🔹 Verify yourself in #buidler-role (skip if you've already done this) 🔹 Choose the contributor role in #role-verify 🔹 Engage the Server Booster Role by Boosting the Server 🔹 Start contributing! The alpha is to stay active in community channels and participate consistently in community activities Roles are reviewed and rewards are calculated on consistent contributions.

Buidlpad

@native_fi · Post #135 · 12.12.2025 г., 11:34

How to verify and receive your roles 🔹 Log in at http://buidlpad.com 🔹 Link your Discord under your Profile 🔹 Join the Buidlpad Discord: http://discord.gg/buidlpad 🔹 Verify yourself in #buidler-verify 🔹 Select your region in #select-region That’s it. Your verification is complete 💙 Or follow this tutorial ⬇️ Or DM : @gBuidl