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

Пребарај: #inflationtarget

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

@CryptoM · Post #65356 · 13.04.2026 г., 02:10

🚀 Japan's Chief Cabinet Secretary Expects BOJ to Implement Appropriate Monetary Policy Japan's Chief Cabinet Secretary, Hirokazu Matsuno, has expressed expectations that the Bank of Japan (BOJ) will implement appropriate monetary policy measures. According to Jin10, Matsuno emphasized the importance of achieving the BOJ's inflation target in a sustainable and stable manner. This statement comes amid ongoing discussions about Japan's economic strategies and the central bank's role in maintaining economic stability. #Japan#BOJ#MonetaryPolicy#InflationTarget#EconomicStability#HirokazuMatsuno#BankOfJapan

Crypto M - Crypto News

@CryptoM · Post #64807 · 10.04.2026 г., 01:19

🚀 BOJ Vice Governor Discusses Inflation Target Strategy Bank of Japan Vice Governor Ryozo Himino stated that the central bank will adopt the most appropriate policy based on the scale and duration of economic shocks, as well as the prevailing economic environment. According to Jin10, Himino emphasized the importance of achieving a stable inflation target, indicating that the BOJ's approach will be tailored to the specific circumstances at the time. This statement reflects the BOJ's ongoing commitment to adjusting its monetary policy in response to changing economic conditions. #BOJ#BankOfJapan#InflationTarget#MonetaryPolicy#EconomicShocks#EconomicStability#RyozoHimino