TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #401 · 15 дек.

Функция asyncio.wait() это еще один способ вызвать множество асинхронных задач. Она работает в нескольких режимах. 1. Самый простой - ждем завершения всех задач async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(10)] done, pending = await asyncio.wait( tasks, return_when=asyncio.ALL_COMPLETED ) for task in done: try: print(task.result()) except Exception as e: print(e) Очень похоже на gather, но работает не так. ▫️возвращает не результаты, а два сета с объектами Task у которых можно забрать результат через task.result() если они в списке done ▫️не гарантирует порядок результатов так как оба объекта это set ▫️не выбрасывает исключение когда оно появляется, а сохраняет его в Task. Исключение появится когда попробуете забрать резултьтат. 2. Ждем завершения первой задачи, даже если там ошибка. async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(3)] done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED ) # в done может быть несколько задач! for task in done: try: print(task.result()) except Exception as e: print(f"Fail: {e}") # Оставшиеся задачи в pending, как правило, нужно отменить, иначе они будут продолжать работать for task in pending: task.cancel() В сете done будут таски которые успели завершится, причем как успешно так и нет. 3. До первой ошибки. Тоже самое, но с аргументом FIRST_EXCEPTION done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_EXCEPTION ) Функция завершается как только первая задача упадет с ошибкой. Учтите, что в любом случае done вы можете обранужить несколько задач, как с ошибками так и успешные. ↗️ Полный листинг примеров здесь #async

Hashtags

Резултати

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

Пребарај: #ratecut

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

@CryptoM · Post #64951 · 10.04.2026 г., 12:07

🚀 Fed's Daly: Rate Hike Less Likely Than Cut or Hold San Francisco Federal Reserve President Mary Daly stated that the likelihood of an interest rate hike is lower compared to the possibility of a rate cut or maintaining the current rates. According to Jin10, Daly's comments reflect the ongoing assessment of economic conditions and monetary policy adjustments. The Federal Reserve continues to monitor various economic indicators to determine the appropriate course of action for interest rates. Daly's remarks suggest a cautious approach towards monetary policy amid evolving economic dynamics. #FederalReserve#InterestRates#MonetaryPolicy#Economy#USEconomy#RateHike#RateCut#EconomicOutlook

Crypto M - Crypto News

@CryptoM · Post #65351 · 13.04.2026 г., 01:57

🚀 Barclays Analysts: Asian Central Banks Likely to Maintain Monetary Policy Amid Middle East Conflict On April 13, Barclays Bank's fixed income, foreign exchange, and commodities research team released a report suggesting that Asian central banks may keep their monetary policies unchanged in the short term due to ongoing Middle East conflicts. According to Jin10, the analysts noted that the Monetary Authority of Singapore is likely to maintain its current policy this week, expressing concerns over the risks of extreme negative growth rather than inflation. Meanwhile, Barclays believes that unless the U.S. dollar significantly depreciates against the Indonesian rupiah before the upcoming Bank Indonesia meeting, the Indonesian central bank is unlikely to quickly resume its rate-cutting cycle. Additionally, the central banks of Thailand and the Philippines, which are also holding meetings this month, are expected to remain on hold. #Barclays#AsianCentralBanks#MonetaryPolicy#MiddleEastConflict#Singapore#Indonesia#Thailand#Philippines#InterestRates#BankIndonesia#USdollar#Rupiah#RateCut