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

Пребарај: #coalapay

当前筛选 #coalapay清除筛选
Venture Village Wall 🦄

@venturevillagewall · Post #4108 · 09.02.2025 г., 19:00

End Chokepoint 2.0 Now! Senator Lummis urges that personal beliefs regarding guns, #Bitcoin, crypto, and religion should not affect banking practices, calling for an end to Chokepoint 2.0. In other news, Coala Pay secures $3.50M in Seed funding led by Castle Island Ventures, alongside participation from Lattice Fund and Factor Capital. Read more here: ICO Analytics #Bitcoin#Crypto#VC#Banking#Funding#Chokepoint2.0 #Politics#SenatorLummis#InternationalAid#CoalaPay#Investing#SeedFunding

Venture Village Wall 🦄

@venturevillagewall · Post #4093 · 07.02.2025 г., 19:00

Utah Legislation on Bitcoin Investment Passes 🚀 The Utah House has passed legislation allowing state investment in Bitcoin, moving it to the Senate for further evaluation. 🔗 Read more about the implications of this bill here. 💸 Stablecoin donation company Coala Pay successfully closed a $3.5 million funding round. 🏦 Fed’s Christopher Waller supports stablecoins as vital for USD's reserve currency status. ✨ SEC is reviewing a Solana-ETF application from Grayscale. 📈 Developers of Berachain have launched their mainnet and conducted an airdrop. 🔒 Japan urges Apple and Google to block five crypto exchanges. #Bitcoin#Stablecoin#CoalaPay#Fed#Stablecoins#SEC#Solana#Grayscale#Berachain#Japan#Crypto#Investment#Legislation#VC#News#USA#Fintech#CryptoExchange#DeFi#Funding#Innovation