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

Резултати

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

Пребарај: #shoigu

当前筛选 #shoigu清除筛选
des Geyers schwarzer Haufen

@FlorianGeyer2024 · Post #2909 · 13.11.2025 г., 15:11

🎙🇷🇺 Überblick - Kernaussagen des Vorsitzenden des russischen Sicherheitsrates Sergei Shoigu in einem Interview mit RIA Nowosti: 🔹️Die Analyse der Notwendigkeit von Nukleartests in Russland wird sofort beginnen; 🔹️Russland erwartet, dass die USA ihr Versprechen einhalten, Nukleartests zu verbieten; 🔹️Die NATO-Länder in Europa könnten jedes Szenario einer Provokation gegen Russland in Betracht ziehen; 🔹️Die EU hat sich effektiv in einen Militärblock verwandelt; 🔹️Russland wartet auf die Antwort der USA auf seinen Vorschlag zur Verlängerung des New-START-Vertrags; 🔹️Tokio opfert seine Interessen, um Washington zu gefallen. Quelle RIA Nowosti 👀 Teilen kann zum Aufwachen beitragen! ✨🆕🌐Hauptkanal ✨▶️🌐 Videokanal ✨▶️🙂Funnykanal #Russland#Shoigu#Interview#RIANowosti

@RusEmbMalta: 🇷🇺🛡️13th International Security Meeting to Be Held in Moscow 📅 On May 27–29, 2025, Moscow will host the 13th International Meeting of High Representatives for Security Issues under the chairmanship of Secretary of the Russian Security Council Sergey Shoigu. 🌍 More than 150 countries from the Global South and East have been invited to participate, along with representatives of the #CIS, #CSTO, #EAEU, #SCO, and over 20 international organizations. 🗂️ The meeting will focus on strengthening international security cooperation. Discussions will cover a broad range of challenges, including terrorism, extremism, transnational crime, drug trafficking, and emerging threats. 🧭 Since 2010, this annual platform has brought together senior security officials to build trust, share expertise, and coordinate efforts on pressing global security issues. 📌 Media accreditation is open until May 20, 2025. #Shoigu#SecurityCouncil#InternationalMeeting#Moscow2025#GlobalSecurity#Counterterrorism#Multilateralism#CIS#SCO#BRICS#CSTO#EAEU#GlobalSouth