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

Пребарај: #bookfair

当前筛选 #bookfair清除筛选
Venezuelanalysis

@venanalysis · Post #2026 · 09.07.2025 г., 19:42

📸 IN IMAGES | Venezuela Challenges Eurocentric Narratives in International Book Fair President Nicolás Maduro inaugurated the 21st edition of the Venezuelan International Book Fair (FILVEN), announcing a new initiative to distribute printed books in schools nationwide. The event, held in Caracas, features Egypt as the guest of honor, commemorating 75 years of diplomatic relations. With 18 publishers from 10 countries, FILVEN runs through July 13 before continuing across other Venezuelan states. Follow the link to check out our gallery: https://venezuelanalysis.com/images/venezuela-challenges-eurocentric-narratives-in-international-book-fair/ #BookFair#Culture

Venezuelanalysis

@venanalysis · Post #1659 · 22.07.2024 г., 22:21

Venezuela Honors South Africa at the 20th International Book Fair At Venezuela’s 20th International Book Fair, South Africa was honored with 18 authors, and Nelson Mandela’s legacy was celebrated. The event also featured Jorge Ramos Tolosa’s book on Palestine. Don’t miss out on the gallery by clicking here 👉🏼https://shorturl.at/PSCso #bookfair#filven#filven2024#venezuela

Green University CA | Official

@centralasian_greenuniversity · Post #601 · 27.12.2025 г., 13:02

📚Book Fair at Green University 📖A book fair was held at the university, bringing together students, faculty, and book lovers in a lively academic atmosphere. The event offered a wide selection of literature, encouraged reading culture, and created a space for meaningful exchange of ideas. #BookFair#ReadingCulture#StudentLife#LoveForBooks ✉️[email protected] ☎️ +998 55 512 00 77 📍Location 🌐Website | 📱Telegram | 📱Instagram | 📱LinkedIn | 🟥YouTube