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

Резултати

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

Пребарај: #dopingpongarchives

当前筛选 #dopingpongarchives清除筛选
dopingpong

@dopingram · Post #4117 · 14.07.2025 г., 08:18

Happy Birthday, Petite Meller! A fragment of the press realise an unrealized joint project. Petite Philosophia X Doping Pong Petite Philosophia will be released later as the world's first perfume that conveys the beautiful scent of philosophy from ancient Greece to the psychoanalysis room. Super singer Petite Meller and brilliant artists group Doping Pong came together in an international project to create the world’s first perfume with the scent of philosophy. Meller explains that the origin of the project came from wanting to create a perfume with the scent of philosophy. According to Meller “In Greek Philo is The Love, Sophia is Wisdom. I asked Russian art-collective Doping Pong to design the book shaped perfume with philosophy written in Russian letters to represent their art collaboration”. Doping Pong art group are the pioneers of digital art in Russia that was founded in 1997 in St. Petersburg. Now, they are apologists for traditional painting. In the past, Doping Pong collaborated with Richardson and Supreme, participated in the collective exhibition "New Classics" - curated by Sasha Bogoev, editor of Juxtapoz magazine and held their retrospective "Doping Pong: Our everything!" at the Erarta Museum of Contemporary Art. Petite Meller is a French Israeli artist and songwriter who brings a philosophical view on life through her music. "Lil Empire" is her debut album with her hit "Baby Love". Her Jazzy pop videos conceals "jouissance" which is in Freud’s terms a pleasure out of pain. Aside from her musical career, Meller received a postgraduate degree in philosophy from the Sorbonne in Paris. For more information on Petite Philosophia, visit Instagram Petite Meller: www.instagram.com/petitemeller #petitemeller#философия#perfume#dopingpong#digitalart#dopingpongarchives