TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #418 · 9 мар.

Оператор pipe позволяет писать более компактный код, реализуя логику объединения данных (Union). Важно помнить, что его поведение зависит от контекста. Побитовые операции (логическое OR) result = 5 | 3 # 5 (0101) | 3 (0011) = 7 (0111) Самое главное - не путать с оператором or, это другое! Объединение множеств set_a = {1, 2, 3} set_b = {3, 4, 5} set_c = set_a | set_b # {1, 2, 3, 4, 5} set_c |= {5, 6} # {1, 2, 3, 4, 5, 6} Слияние словарей dict_1 = {"a": 1, "b": 2} dict_2 = {"b": 3, "c": 4} merged = dict_1 | dict_2 # {'a': 1, 'b': 3, 'c': 4} merged |= {"d": 5} # {'a': 1, 'b': 3, 'c': 4, 'd': 5} Аннотации типов, заменяет Union def process_data(value: int | str) -> None: print(value) Допустимо использовать в isinstance или issubclass isinstance(3, int | float) # True Паттерн-матчинг status_code = 404 match status_code: case 200 | 201 | 204: print("OK") case 400 | 404 | 500: print("ERROR") Для использования в своих классах требуется переопределить метод __or__ Так же нашел библиотеку pipe которая добавляет еще много возможностей. Рекомендую ознакомиться ;) #basic

Hashtags

Резултати

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

Пребарај: #deficit

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

@America · Post #10610 · 06.05.2026 г., 14:12

💸🇺🇸GOP MEGABILL EXPLODES DEFICIT BY $4.1 TRILLION — CBO CONFIRMS BIGGEST DEBT BOMB EVER 🔹 House Republicans' "One Big Beautiful Bill Act" adds $4.1T to deficit over 10 years, including $718B in higher debt service costs 📊 🔹 $5T in tax cuts mostly to wealthy/corporations vs only $1-2T in spending cuts — math doesn't add up for middle class 💰 🔹 Drives up borrowing costs nationwide: higher mortgage rates, auto loans, credit cards as federal debt crowds out private lending 📈 🔹 Moody's cited this bill for recent US credit downgrade — GOP "pay for itself" claims dismissed by independent analysis 📉 America's fiscal time bomb just got $4 trillion bigger 💣🔥 #USNews#deficit @america

America 🇺🇸 News & Politics

@America · Post #10565 · 27.04.2026 г., 13:09

📊💰ECONOMISTS: TRADE DEFICITS MADE AMERICA RICHER, NOT POORER 🔹 US has run trade deficit every year since 1976 — but that created wealth, not drained it 💵📈 🔹 February 2026 deficit at $57.3B, down 54.8% from 2025 as Trump policies reshape global trade 🇺🇸⚖️ 🔹 China deficit drops 32% annually while US achieves first goods surplus with Switzerland since 2012 🇨🇭✅ 🔹 Imports bring investment inflows and boost American consumer power — not economic loss says George Mason professor 🎓💡 "Expanding imports brought greater wealth to U.S. shores" — challenging conventional wisdom 🤔📰 Trump's trade war might actually be working this time 🔄🎯 #trade#economy#deficit#imports @america

Savino Balzano

@savinobalzano · Post #688 · 29.06.2024 г., 14:25

Questa mattina a Coffee Break, La7 Ci aprono una procedura di infrazione per deficit eccessivo? Dobbiamo saper rispondere #sticazzi! E lo dobbiamo fare in scioltezza. L'#Italia deve ritrovare orgoglio e dignità: non avremmo dovuto subire l'ingorda prepotenza di qualcun altro e di certo non possiamo permetterci di continuare a farlo. Non esistono soluzioni facili: non bastano due leggine per risolvere i nostri annosi problemi. Molti di quei problemi ce siamo creati da soli, accettando per stupidità o per servilismo assurdi compromessi. Basta. #lavoro#diritti#europa#commissione#deficit#caporalato https://x.com/SavinoBalzano/status/1807056685476778486?t=E9HfjCNDdU7CogMYT7sw6g&s=19