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

Пребарај: #yarn

当前筛选 #yarn清除筛选
BotsGram®

@botsgram_cu · Post #3165 · 25.11.2020 г., 11:17

@newreleasesiobot Qué puede hacer este bot? Este bot lanza notificaciones de muchas plataformas de programación GitHub, Docker, PyPI, Maven, Gems, NPM, Yarn ... Idioma: Inglés (visto en @BotsGram.cu) #releases, #version, #github, #docker, #maven, #npm, #yarn, #git, #bitbucket, #notifications

djangoproject

@djangoproject · Post #535 · 28.12.2017 г., 10:12

https://docs.pipenv.org/ #Pipenv — the officially recommended #Python#packaging tool from Python.org, free (as in freedom). Pipenv is a tool that aims to bring the best of all packaging worlds (#bundler, #composer, #npm, #cargo, #yarn, etc.) to the Python world. #Windows is a first–class citizen, in our world. It automatically creates and manages a #virtualenv for your projects, as well as adds/removes #packages from your #Pipfile as you install/uninstall packages. It also generates the ever–important Pipfile.lock, which is used to produce deterministic builds.

GitHub Trends

@githubtrending · Post #14678 · 07.05.2025 г., 11:30

#python#api#bracket#brackets#docker#docusaurus#fastapi#json#mantine#nextjs#postgresql#python#react#reactjs#selfhosted#sports#tournament_bracket#tournament_manager#tournaments#web#yarn Bracket is a tool for organizing tournaments. It supports different formats like single elimination, round-robin, and Swiss. You can create teams, add players, and manage multiple clubs with several tournaments. The system allows you to drag-and-drop matches to different courts or reschedule them. It also provides customizable dashboard pages for public viewing. This makes it easier to manage and engage with tournaments, offering more flexibility and control for organizers and participants. https://github.com/evroon/bracket