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

Резултати

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

Пребарај: #trmlabs

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

@venturevillagewall · Post #4282 · 02.03.2025 г., 01:00

Bitcoin: Panic Buying Amid Market Shakeup Panic reactions in the market are evident as Bitcoin fluctuates. Key developments in the TON ecosystem include: - TVM Ventures launching a $100M fund for TON growth 🔗 - Updates from TON Core for Dec 2024 - Jan 2025 🔗 - Steve Yun discusses DeFi’s future in Telegram on CNBC 🔗 - First mid-core web3 game launched on TON 🔗 - Support program for Mini Apps initiated 🔗 - Innovations from Notcoin team highlighted 🔗 - LayerZero’s new USDT bridge enhances TON’s cross-chain capabilities 🔗 - Key investments in DeFi and SocialFi detailed by TVM Ventures 🔗 - TON’s ecosystem expands beyond major project monopolies 🔗 - TRM Labs introduces a comprehensive blockchain analysis tool for TON 🔗 - The domain believers.ton is permanently lost 🔗 #Bitcoin#DeFi#TON#Crypto#Web3#Investment#LayerZero#Blockchain#MiniApps#PanicBuying#TVMVentures#Notcoin#TRMLabs

Crypto M - Crypto News

@CryptoM · Post #64673 · 09.04.2026 г., 13:26

🚀 Drift Faces $285 Million Exploit Due to Social Engineering Tactics Drift experienced a significant exploit amounting to $285 million, attributed to suspected North Korean operatives employing in-person social engineering against its contributors. According to NS3.AI, the group targeted contributors at several major industry conferences over a six-month period leading up to the exploit. TRM Labs identified this incident as the largest DeFi hack of 2026 to date and the second-largest exploit in Solana's history. The attacker reportedly utilized CarbonVote Token to secure collateral acceptance, increase withdrawal limits, and extract assets, including USDC. #Drift#exploit#socialengineering#NorthKorea#DeFi#Solana#CarbonVoteToken#TRMLabs#USDC#cybersecurity

Crypto M - Crypto News

@CryptoM · Post #65273 · 12.04.2026 г., 13:10

🚀 Iran Reopens Strait of Hormuz with Bitcoin Toll Amid Ceasefire Iran has reopened the Strait of Hormuz under a two-week ceasefire, requiring tankers to pay a $1-per-barrel toll in Bitcoin for passage. According to NS3.AI, Hamid Hosseini stated that the system now processes 10 to 15 vessels daily, a significant decrease from the 135 vessels before the conflict. TRM Labs reported that since mid-March, Iran's military has collected up to $2 million per ship in Bitcoin, Chinese yuan, and potentially USDT. #Iran#StraitOfHormuz#BitcoinToll#Ceasefire#Tankers#NS3AI#Hosseini#TRMLabs#Military#Crypto#USDT#ChineseYuan#Shipping#Blockchain#IranEconomy#BTC