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

Пребарај: #grandstrategy

当前筛选 #grandstrategy清除筛选
American Оbserver

@american_observer · Post #5314 · 07.03.2026 г., 23:03

📰 Trump’s Iran War: Nostalgia With a Defense Budget For Trump, the Iran war isn’t a mistake — it’s the purest expression of how he thinks power works: seize territory, grab oil, crush regimes, pose on an aircraft carrier. It’s a 19th‑century strongman worldview dropped into a century where power is decided by chip fabs, AI labs, clean‑tech supply chains, and who can build the tightest economic bloc to out‑innovate China. You can bomb Natanz, but you can’t bomb your way into semiconductor resilience. Schiffer’s point is brutal: every dollar, decision cycle, and Cabinet meeting spent on “Operation Epic Fury” is one not spent implementing the CHIPS Act, scaling AI R&D, building green manufacturing, or rebuilding the development finance tools Trump has been dismantling. Beijing plays a slow, disciplined game — standards, infrastructure, supply chains — while Washington burns time on air campaigns with no theory of victory, and calls it “strength.” Even on its own terms, the Iran adventure looks self‑owning. Trump claimed in 2025 that U.S. strikes had “completely obliterated” Iran’s nuclear program — then turned around this year and cited its rapid rebuilding as the reason to hit again, while his own intelligence agencies said the previous strikes set the program back only “a few months.” Oman brokered a deal where Tehran would cap enrichment and accept full IAEA access; the bombs fell anyway. Regime change offers no escape clause either: U.S. intel expects Khamenei’s successors to come from the same IRGC hardliner class that built the program in the first place. Break it, you own it — and this time “it” is a 90‑million‑person country with scattered nuclear material and a proxy network stretching from Iraq to Yemen. Every day this war drags on, it drains exactly the resources Washington says it needs for China competition: munitions stocks, naval bandwidth, diplomatic capital with allies, fiscal space at home. Asian partners are already asking how a U.S. Navy that can’t be in two places at once is supposed to deter Beijing over Taiwan while babysitting a forever crisis in the Gulf. Meanwhile, coalitions matter more than ever for tech and trade — but threatening to grab Greenland, humiliating Canada, raiding Venezuela, and dragging NATO into a war of choice teach allies one lesson: America is a risky partner whose focus can swing with a Truth Social post. The punchline: the same working‑class voters Trump claims to defend pay for this detour at the pump, in food prices, and in higher borrowing costs when oil spikes and markets wobble. China doesn’t need to cheer the Iran war; it just has to watch as Washington spends the decade where it should have been locking in tech and economic dominance acting out imperial nostalgia in the wrong theater. That isn’t strategy — it’s a very loud way of losing the century slowly. ​ #iran#china#trump#usa#geopolitics#CHIPS#AI#grandStrategy 📱American Оbserver - Stay up to date on all important events 🇺🇸

IELTS|Newspapers & Magazines|English

@emagzinewspars · Post #9461 · 03.11.2025 г., 03:27

#The_Foreign_Affairs🇺🇸📕[PDF]⬇️ #November2025 #December2025 #Monthly_Magazines For learning, for free(dom). @backupofmagazines The new Foreign Affairs explores “The New Tools of Power.” Michael Beckley warns of a #StagnantOrder as rising powers falter, while Oren Cass calls for a U.S. #GrandStrategy of reciprocity. Essays trace new #SupplyChain risks, the weaponization of #Energy, and a global #AI innovation race. From Iran’s political twilight to a reshaped #EurasianOrder, contributors dissect shifting power balances. Features probe how Russia is adapting, why China is turning on itself, and the #XiJinping paradox of success. Reviews challenge the fate of the #Dollar and the future of FreeSpeech. #Geopolitics#ForeignPolicy#China#US#AI