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

Резултати

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

Пребарај: #aatmarnirbharbharat

当前筛选 #aatmarnirbharbharat清除筛选
Indian Development News 🇮🇳

@developmentnewsindia · Post #43514 · 12.04.2026 г., 12:51

DRDO Chief Dr. Samir V Kamat has inaugurated a Compo-Rheo Die Casting (CRDC) facility at IISc-Bengaluru Campus for producing high-performance alloys. CRDC is an advanced hybrid metallurgical process that combines elements of Composite material fabrication & Rheocasting to produce high-performance metal matrix composites. #aatmarnirbharbharat

Indian Development News 🇮🇳

@developmentnewsindia · Post #44375 · 03.05.2026 г., 16:31

Mishra Dhatu Nigam Limited (MIDHANI) has inaugurated a state-of-the-art Aerospace Fasteners Facility in Hyderabad, marking its transition into a fully integrated manufacturer of high-precision components for extreme environments, including titanium and superalloy fasteners. By maintaining 100% in-house production and hosting resident inspection agencies, the facility ensures stringent quality control and compliance for the defense and aerospace sectors. Source #aatmarnirbharbharat#defence

Indian Development News 🇮🇳

@developmentnewsindia · Post #44228 · 30.04.2026 г., 09:47

DRDO Chairman Dr Samir V Kamat said the Ghatak UCAV will be comparable to a stealth fighter in capability. "They will be like fighters, they would be a stealth fighter... about a 13-ton class... LCA type fighter aircraft," Kamat said, adding that a recent proposal cleared by the Defence Procurement Board envisages induction of around 67 such systems. #Defence#aatmarnirbharbharat

Indian Development News 🇮🇳

@developmentnewsindia · Post #43776 · 18.04.2026 г., 10:07

Union Cabinet approves Bharat Maritime Insurance pool (BMI pool) with a sovereign guarantee of Rs 12,980 crore to facilitate continuous maritime insurance coverages: I&B Minister Ashvini Vaishnav This will reduce dependence on foreign insurance providers for maritime transport #Policy#aatmarnirbharbharat

12
ПретходнаСтраница 1 од 2Следна