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

Пребарај: #barrios

当前筛选 #barrios清除筛选
Venezuelanalysis

@venanalysis · Post #2340 · 18.04.2026 г., 20:52

🖊🗞COLUMN | Self-Management in Cota 905: From the Most Dangerous Barrio to an Open Air Art Gallery VA columnist Jessica Dos Santos documents how a grassroots initiative is helping Cota 905 overcome its stigma of armed gangs and police violence. Between 2014 and 2021, Cota 905 in Caracas was under the control of armed gangs, impacting around 300,000 residents and limiting access to services. In 2021, the government launched Operation Gran Cacique Indio Guaicaipuro, deploying 34 checkpoints as part of a large-scale security intervention. Following these events, a community initiative called “The Cota 905 Tour: A Thousand Stories, Over a Hundred Murals, One Route” was developed. The project includes more than 100 murals and was created with participation from residents, artists, and local collectives. It has been officially recognized by Venezuela’s Ministry of Tourism. Read the full VA column here: https://venezuelanalysis.com/columns/self-management-cota-905-from-the-most-dangerous-barrio-to-an-open-air-art-gallery #Barrios#Cota905#TalesofResistance

Ultimora.net - POLITICS

@ultimoraPOLITICS · Post #39553 · 16.05.2022 г., 18:00

#Sondaggi#USA#Governative#Texas Sondaggio di UTT: Greg #Abbott (#R|ECR): 46% (+1) Beto #ORourke (#D|Centro-sinistra): 39% (+1) Delilah #Barrios (#GPUS|Verdi): 3% (+3) Mark Jay #Tippetts (#LP|Libertari): 3% (+3) Qualcun altro: 8% (-8) Non lo so: 2% (+1) Data rilevazione: 2-10 maggio +/-: 8-15 febbraio Intervistati: 1232 @UltimoraPolitics