TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #401 · 15 дек.

Функция asyncio.wait() это еще один способ вызвать множество асинхронных задач. Она работает в нескольких режимах. 1. Самый простой - ждем завершения всех задач async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(10)] done, pending = await asyncio.wait( tasks, return_when=asyncio.ALL_COMPLETED ) for task in done: try: print(task.result()) except Exception as e: print(e) Очень похоже на gather, но работает не так. ▫️возвращает не результаты, а два сета с объектами Task у которых можно забрать результат через task.result() если они в списке done ▫️не гарантирует порядок результатов так как оба объекта это set ▫️не выбрасывает исключение когда оно появляется, а сохраняет его в Task. Исключение появится когда попробуете забрать резултьтат. 2. Ждем завершения первой задачи, даже если там ошибка. async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(3)] done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED ) # в done может быть несколько задач! for task in done: try: print(task.result()) except Exception as e: print(f"Fail: {e}") # Оставшиеся задачи в pending, как правило, нужно отменить, иначе они будут продолжать работать for task in pending: task.cancel() В сете done будут таски которые успели завершится, причем как успешно так и нет. 3. До первой ошибки. Тоже самое, но с аргументом FIRST_EXCEPTION done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_EXCEPTION ) Функция завершается как только первая задача упадет с ошибкой. Учтите, что в любом случае done вы можете обранужить несколько задач, как с ошибками так и успешные. ↗️ Полный листинг примеров здесь #async

Hashtags

Резултати

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

Пребарај: #fix

当前筛选 #fix清除筛选
ChatGPT AI Technology News

@chatgpt_officialnews · Post #317 · 24.10.2025 г., 14:51

🚀 The speed of the bot has increased and the problem of unresponsiveness has been solved We have also added a new task for you to get 5,000 tokens in 3 seconds ☕️ Most importantly, if you send a photo to the bot, you can edit it much more easily and... Try it😉 💎https://t.me/chatgpt_officialbot If you have any problems or find a bug, send a message to support and get a bunch of free tokens:@OpenAI_helpdesk🔥 ➖➖➖➖🔻 🧠 BOT: @Chatgpt_OfficialBOT 💎@Chatgpt_OfficialNews #️⃣#Bot#Fix#Photo#Update ➖➖➖➖🔺

ChatGPT AI Technology News

@chatgpt_officialnews · Post #314 · 22.10.2025 г., 06:19

Remember when you used to run out of tokens and watching ads felt so boring and time-consuming? 😅 Now, the “Fast Free Tokens” task section has been completely redesigned to be much simpler and clearer. Plus, we’ve added new tasks that let you earn free tokens in just 3 seconds! 🎁 No more hassle — just fast, easy, and unlimited fun with AI 🤖✨ ⚡️ Some of you mentioned bugs and slow performance — they’re all fixed now! The bot is much smoother and faster than before. 🖼 There was also an issue with photo editing being inaccurate or glitchy sometimes. Now that part is stronger than ever — with higher precision, fewer bugs, and no increase in token prices, you can edit your photos exactly how you like 🔥 Give it a try — we’re sure you’ll love it 😉 @chatgpt_officialbot ➖➖➖➖🔻 🧠 BOT: @Chatgpt_OfficialBOT 💎@Chatgpt_OfficialNews #️⃣#Bot#Fix#Photo#Update ➖➖➖➖🔺

探索号

@seeker_rc · Post #19911 · 07.05.2026 г., 16:55

Fix: Unable to make changes as organizer of Family Sharing Learn what to do if you are unable to make important changes to Screen Time, subscriptions, and other settings for family members. via iDB - Mac 标签: #make#changes#Fix ⚡️探索号频道 ⚡️探索者频道 ⚡️探索者交流群 ⚡️ Youtube 频道:科技探索者 每天推荐有趣内容,欢迎订阅、转发。