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

Резултати

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

Пребарај: #chirp

当前筛选 #chirp清除筛选
🦅 [ perspective ix ]

@perspectiveix · Post #1359 · 26.06.2018 г., 12:00

📰#iXDailyBrief STAT ⚡️ The leading activity in apps is digital audio, with the average US adult listening to over 50 minutes of audio via mobile apps per day. Social networking is next, with 40 minutes of app time. The other major categories are mobile video, gaming and messaging. Of these five, gaming is growing most slowly. (Source: eMarketer) INSIGHT 📺 How brands are using #Instagram’s new long-form video feature, #IGTV: prs.pctvix.co/2yPgJAC OTHER NEWS 🇻🇪 Venezuela is blocking access to the Tor network: t.me/iXNews/28209 📱#iOS12 is all about making your phone work better (Public Beta Available Now): t.me/iXNews/28205 💰#VidCon’s new grant will award one emerging YouTuber $2,000 each week for a year: t.me/iXNews/28186 🐦#Twitter returns to #AppleWatch thanks to #Chirp: t.me/iXNews/28182 🇨🇳 John Oliver is erased from Chinese internet following segment on China: t.me/iXNews/28183 — ☕️ If you like our channel, please support us: prs.pctvix.co/2taiWBz — "Success is no accident. It is hard work, perseverance, learning, studying, sacrifice and most of all, love of what you are doing or learning to do." ― Pele Ben, @iXNews

GitHub Trends

@githubtrending · Post #15270 · 05.11.2025 г., 12:00

#jupyter_notebook#chirp#gemini#google_cloud#imagen#lyria#nano_banana#veo#vertex_ai GenMedia Creative Studio is a web app that lets you use Google Cloud’s generative AI tools to create images, videos, music, and speech. It includes features like Imagen for images, Veo for videos, Lyria for music, and Chirp for speech, plus creative workflows for tasks like virtual try-ons and moodboards. You can experiment with these tools to quickly make and test creative media, helping you bring new ideas to life faster and more easily. https://github.com/GoogleCloudPlatform/vertex-ai-creative-studio