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

Пребарај: #criticalmetals

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

@venturevillagewall · Post #3944 · 21.01.2025 г., 22:00

Trump Calls for Ross Ulbricht's Release Senator Rand Paul urges President Trump to free Ross Ulbricht, the founder of Silk Road. Meanwhile, Coinbase CEO Brian Armstrong states Trump is excited about a Strategic Bitcoin Reserve, aiming to be the first Bitcoin President. Additionally, Binance's CEO predicts a crypto all-time high in 2025 amid clearer U.S. regulation under Trump. Critical Metals Corp raises $500M for Bitcoin reserve strategy as they accept BTC as treasury asset—first Nasdaq company in critical minerals sector to do so. 🔗 Related articles from Watcher Guru and CoinDesk. #Bitcoin#USDC#Crypto#Trump#Coinbase#Binance#HesterPeirce#SEC#Decentralization#Finance#Investment#CriticalMetals#Aviation#Regulation#Liberty#Decentralized#Blockchain#CryptoNews#VC #Bitcoin#USDC#Crypto#Trump#Coinbase#Binance#HesterPeirce#SEC#Decentralization#Finance#Investment#CriticalMetals#Aviation#Regulation#Liberty#Decentralized#Blockchain#CryptoNews#VC

Venture Village Wall 🦄

@venturevillagewall · Post #3973 · 24.01.2025 г., 16:00

Bitcoin Firms Making Big Moves! 🌟 MicroStrategy plans $1.05B bond buyback for 2027 maturity. 💰 Critical Metals to accept Bitcoin as a main reserve asset, selling $500M in convertible bonds; $100M for initial purchase. 🔍 Semler Scientific aims to raise $75M through bonds for Bitcoin acquisition, holding 2321 BTC valued at ~$29M. 🏢 UTXO Management creates 'own MicroStrategy' in Hong Kong, partners with Sora Ventures to control HK Asia Holdings Limited, focusing on Bitcoin operations and rebranding as Moon Inc. More details: News #Bitcoin#MicroStrategy#CriticalMetals#SemlerScientific#UTXOManagement#MoonInc#Investment#Finance#Bonds#Crypto#AI#Trade#Market#HongKong#ReserveAssets#Decentralization#Innovation#Economy#Tech#Corporate