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

Пребарај: #elbrus

当前筛选 #elbrus清除筛选
Beyond Moscow

@beyondmoscow · Post #2096 · 11.12.2025 г., 10:15

The ski season at #Elbrus has opened in spectacular fashion. Let’s recall that this is the highest-altitude ski resort in Russia, featuring the highest cable car in the country — Mir–Gara-Bashi, which lifts visitors up to 3,847 m. Climbers accustomed to reaching such heights on foot will appreciate it — though they will still choose to go on foot 🙌🏻 Elbrus offers a magnificent opportunity to ski non-stop from the top station at 3,847 m all the way to the foot of the mountain. Two ski areas are already open: 1. Krugozor–Mir — 3,000–3,500 m 2. Mir–Gara-Bashi — 3,500–3,847 m —> The Azau–Krugozor section (2,350–3,000 m) is being prepared for opening. A new ski zone has been launched near the Terskol Peak Observatory — Bashtala–Chiran, at an altitude of 3,300–3,560 m. It includes 5 km of black and red runs, as well as two lifts: a chairlift and a gondola. 📍 Map of slopes and lifts Additionally, Elbrus now has illuminated slopes, making evening skiing available. But the news that excited me most: this summer, at an altitude of 3,900 m, a mountaineering village with 15 residential modules will open. Time to head to Elbrus! 🏙️Beyond Moscow🏔️

Hashtags

📰АЛАНЫ ВО ВСЁМ МИРЕ. НАМ ПОРА ОБЪЕДИНИТЬ УСИЛИЯ И ПОДГОТОВИТЬ ОСНОВУ ДЛЯ ВОССТАНОВЛЕНИЯ СВОЕЙ СТРАНЫ. Аланский Народ разбросан сегодня по всему миру. В ЕС, США, Канаде, Австралии, Южной Америке живут наши соплеменники. Я считаю что нам самое время заняться формированием своего собственного правительства в изгнании, тем самым взяв ответственность за свою судьбу в свои руки. #Аланла#Alanla#Karachay#Malkar#Elbrus 🔗Читать полностью 📋 Источник: Taulan Salpagarov

СКИТУР КЭМП в Приэльбрусье! Даты с 6-12 апреля⚡️Осталось: 5 мест! #snowboarding#freeride#elbrus#caucasus#скитур#сноубординг#фрирайдсгидами#эльбрус#чегет#приэльбрусье#кавказ