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

Резултати

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

Пребарај: #contractscandal

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

@venturevillagewall · Post #4269 · 28.02.2025 г., 16:00

Weekly News Highlights: AI, Bitcoin, and Funding 🔍Anthropic AI Guide: Explore how to create effective AI agents. Check out the guide and the video. 💼Fake Contracts Scandal: Woman faked $1 billion contracts to secure funding for an underwater cable in Alaska. Full story here. 🎧AI in Warfare: CEO of Anduril discusses AI’s impact on military with a16z in this podcast. 💻Jobright AI Assistant: New tool simplifies job search by parsing listings and filtering for H1B eligibility. 💵BlackRock's Bitcoin ETF: Added its Bitcoin ETF to model portfolios, marking a significant development. See details here. 🌐Funding Rounds: 1. High-performance blockchain Optimum closes Angel funding. 2. Endless raises $1M for decentralized cloud protocol. 3. Aurum secures $12M for AI-driven asset management. 🚨Lost Bitcoin Wallet Access: Unlocking a wallet with over 31,000 BTC using a new method. 📊Grayscale Fund Allocation: Latest holdings show diverse investment in crypto assets including SOL, ETH, and Cardano. For more info, visit here. #AI#Crypto#VC#Bitcoin#Funding#Technology#Blockchain#Innovation#Investment#Startup#AIagents#JobSearch#MilitaryTech#Decentralization#H1B#ContractScandal#Ethereum#Grayscale#Metaverse#NFTs#Solana