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

Пребарај: #industrialoutput

当前筛选 #industrialoutput清除筛选
Crypto M - Crypto News

@CryptoM · Post #65447 · 13.04.2026 г., 09:14

🚀 Investors May Shift Focus from Geopolitical News to Economic Data, Analyst Suggests On April 13, Christian Gattiker, Head of Research at Bank Julius Baer, indicated in a research report that investors might be becoming less sensitive to daily Middle Eastern headlines. According to Jin10, Gattiker noted that after weeks of geopolitical dominance in the markets, there is a significant possibility that investors will cautiously return to a more 'normal' market mechanism, focusing on macroeconomic data and corporate fundamentals. Upcoming U.S. producer price data, industrial output figures, and the Federal Reserve's Beige Book are expected to provide insights into inflation dynamics and potential economic momentum. #Investors#GeopoliticalNews#EconomicData#Macroeconomics#CorporateFundamentals#USProducerPriceData#IndustrialOutput#FederalReserve#Inflation#EconomicMomentum

Crypto M - Crypto News

@CryptoM · Post #64529 · 09.04.2026 г., 06:19

🚀 Germany's Industrial Output Falls Unexpectedly in February Germany's Federal Statistical Office announced on Thursday that industrial output in February unexpectedly declined, with energy price shocks from Middle Eastern conflicts expected to further suppress production. According to Jin10, industrial output fell by 0.3% month-on-month in February, following a revised flat reading in January. The market had generally anticipated a 0.5% increase for February. The decline in output was primarily driven by decreases in the construction sector, as well as in the electronics, optical products, and pharmaceutical industries. In contrast, the Federal Statistical Office noted that automobile production saw growth after a significant drop in January. #Germany#IndustrialOutput#Economy#Manufacturing#Construction#Electronics#Pharmaceuticals#Automobile#EnergyPrices#February