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

Пребарај: #dynamic

当前筛选 #dynamic清除筛选
GitHub Trends

@githubtrending · Post #15282 · 09.11.2025 г., 14:00

#shell#aesthetic#dark_mode#dynamic#hyde#hyprdots#light_mode#themes#unix_porn#wallpapers HyDE is a clean, modular, and visually appealing development environment designed for Hyprland on Arch Linux and some Arch-based distros. It offers easy installation via a script that auto-detects NVIDIA cards and configures necessary drivers, but it may conflict with existing desktop environments or theming. You can customize it with many official and community themes using a tool called themepatcher. HyDE keeps your configuration organized and separate from core scripts, making updates safer and simpler. It also supports running in a virtual machine for testing. Joining the HyDE Discord community helps you get support and share ideas. This setup benefits you by providing a stylish, maintainable, and customizable desktop environment with a smooth update process and community support. https://github.com/HyDE-Project/HyDE

Dreams Gallery

@dreamsgallerys · Post #1515 · 26.10.2023 г., 22:10

День токена "Remove", и так или иначе кто-то что-то здесь убирает 🤓 Dreams Gallery By Voodoont #voodoont #арт#art#ai#remove#surreal#movie#matrix#cinema#dynamic#black_widow#thanos#iron_man#epic#inktober