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

Пребарај: #alabama

当前筛选 #alabama清除筛选
America 🇺🇸 News & Politics

@America · Post #10636 · 11.05.2026 г., 13:04

⚖️🗳️ALABAMA GOP RACES TO REDRAW HOUSE MAPS BEFORE 2026 🔹 Special session passes bills for NEW House primaries if courts approve GOP maps 📋⚡ 🔹 Target: Flip Democratic Rep. Shomari Figures' AL-02 seat back to Republican 🔄 🔹 Would pack Black voters into fewer districts despite 27% of state population 👥 🔹 Gov. Kay Ivey: "Alabama stands ready to quickly act" on favorable rulings 🏛️ Democrats call it a "power grab echoing Jim Crow" — but GOP says Alabama's Republican tilt should match its maps! 11th Circuit decision could flip House control! ⚖️🔥🇺🇸 #Alabama#Redistricting#VotingRights @america

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40223 · 30.11.2025 г., 03:03

🌠 On November 30, 1954, Ann Hodges of Sylacauga, Alabama, became the first documented person in modern history to be struck by a meteorite. The rock crashed through her roof 🏠, bounced off a radio 📻, and struck her hip, leaving a large bruise 💢. She became an overnight sensation, but the event took a heavy toll on her life 😔. @googlefactss#History#Meteorite#AnnHodges#Alabama#UniqueEvents

Venture Village Wall 🦄

@venturevillagewall · Post #4100 · 08.02.2025 г., 16:00

U.S. States Embrace Bitcoin Reserves A surge in U.S. states pursuing legislation for strategic bitcoin reserves highlights increasing institutional interest in cryptocurrency. 15 states, including Alabama, Arizona, Florida, and Texas, are taking steps to incorporate bitcoin into financial strategies, aimed at attracting businesses and enhancing economic stability. The federal conversation on a national reserve is beginning, as states like Arizona and Utah are closest to legislative success. This movement reflects a broader trend recognizing bitcoin's potential as a financial tool. #Bitcoin#Crypto#Finance#Legislation#Investment#Blockchain#Arizona#Texas#Alabama#EconomicStability#PublicFunds#DigitalAssets#Utah#Kentucky#InstitutionalInterest#VC#SBR#MarketTrends#FinancialInnovation