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

Резултати

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

Пребарај: #rennes

当前筛选 #rennes清除筛选
AI match predictions

@ai_match_prediction · Post #11281 · 04.04.2026 г., 09:05

France Ligue 1🇫🇷 2026-04-04 15:00 UTC Strasbourg vs. Nice Predicted outcome: Strasbourg✅ Predicted score: 2:1 Actual: Strasbourg 3:1 #Strasbourg#Nice 2026-04-04 17:00 UTC Stade Brestois 29 vs. Rennes Predicted outcome: Draw❌ Predicted score: 2:2 Actual: Rennes 3:4 #StadeBrestois29#Rennes 2026-04-04 19:05 UTC Lille vs. Lens Predicted outcome: Lens❌ Predicted score: 1:2 Actual: Lille 3:0 #Lille#Lens #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11591 · 19.04.2026 г., 05:05

France Ligue 1🇫🇷 2026-04-19 13:00 UTC Monaco vs. Auxerre Predicted outcome: Monaco❌ Predicted score: 2:1 Actual: Draw 2:2 #Monaco#Auxerre 2026-04-19 15:15 UTC Nantes vs. Stade Brestois 29 Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #Nantes#StadeBrestois29 2026-04-19 15:15 UTC Strasbourg vs. Rennes Predicted outcome: Draw❌ Predicted score: 2:2 Actual: Rennes 0:3 #Strasbourg#Rennes 2026-04-19 15:15 UTC Metz vs. Paris FC Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Paris FC 1:3 #Metz#ParisFC 2026-04-19 18:45 UTC Paris Saint Germain vs. Lyon Predicted outcome: Paris Saint Germain❌ Predicted score: 2:1 Actual: Lyon 1:2 #PSG#Lyon #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11749 · 26.04.2026 г., 09:05

France Ligue 1🇫🇷 2026-04-26 13:00 UTC Lorient vs. Strasbourg Predicted outcome: Lorient❌ Predicted score: 3:2 Actual: Strasbourg 2:3 #Lorient#Strasbourg 2026-04-26 15:15 UTC Rennes vs. Nantes Predicted outcome: Rennes✅ Predicted score: 2:1 Actual: Rennes 2:1 #Rennes#Nantes 2026-04-26 15:15 UTC Le Havre vs. Metz Predicted outcome: Le Havre❌ Predicted score: 2:1 Actual: Draw 4:4 #LEHavre#Metz 2026-04-26 15:15 UTC Paris FC vs. Lille Predicted outcome: Lille✅ Predicted score: 1:2 Actual: Lille 0:1 #ParisFC#Lille 2026-04-26 18:45 UTC Marseille vs. Nice Predicted outcome: Marseille❌ Predicted score: 3:1 Actual: Draw 1:1 #Marseille#Nice #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11152 · 22.03.2026 г., 09:05

France Ligue 1🇫🇷 2026-03-22 14:00 UTC Lyon vs. Monaco Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Monaco 1:2 #Lyon#Monaco 2026-03-22 16:15 UTC Marseille vs. Lille Predicted outcome: Marseille❌ Predicted score: 2:1 Actual: Lille 1:2 #Marseille#Lille 2026-03-22 16:15 UTC Rennes vs. Metz Predicted outcome: Rennes❌ Predicted score: 3:1 Actual: Draw 0:0 #Rennes#Metz 2026-03-22 16:15 UTC Paris FC vs. Le Havre Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Paris FC 3:2 #ParisFC#LEHavre 🔥 PREMIUM PICK 🔥 2026-03-22 19:45 UTC Nantes vs. Strasbourg Predicted outcome: Strasbourg✅ Predicted score: 1:2 Actual: Strasbourg 2:3 #Nantes#Strasbourg #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11875 · 03.05.2026 г., 05:05

France Ligue 1🇫🇷 2026-05-03 13:00 UTC Lille vs. Le Havre Predicted outcome: Lille❌ Predicted score: 1:0 Actual: Draw 1:1 #Lille#LEHavre 2026-05-03 15:15 UTC Strasbourg vs. Toulouse Predicted outcome: Strasbourg❌ Predicted score: 2:1 Actual: Toulouse 1:2 #Strasbourg#Toulouse 2026-05-03 15:15 UTC Auxerre vs. Angers Predicted outcome: Auxerre✅ Predicted score: 2:1 Actual: Auxerre 3:1 #Auxerre#Angers 2026-05-03 15:15 UTC Paris FC vs. Stade Brestois 29 Predicted outcome: Paris FC✅ Predicted score: 2:1 Actual: Paris FC 4:0 #ParisFC#StadeBrestois29 2026-05-03 18:45 UTC Lyon vs. Rennes Predicted outcome: Lyon✅ Predicted score: 3:2 Actual: Lyon 4:2 #Lyon#Rennes #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #12027 · 10.05.2026 г., 13:05

France Ligue 1🇫🇷 2026-05-10 19:00 UTC Angers vs. Strasbourg Predicted outcome: Strasbourg❌ Predicted score: 1:2 Actual: Draw 1:1 #Angers#Strasbourg 2026-05-10 19:00 UTC Paris Saint Germain vs. Stade Brestois 29 Predicted outcome: Paris Saint Germain✅ Predicted score: 3:1 Actual: Paris Saint Germain 1:0 #PSG#StadeBrestois29 2026-05-10 19:00 UTC Monaco vs. Lille Predicted outcome: Lille✅ Predicted score: 1:2 Actual: Lille 0:1 #Monaco#Lille 2026-05-10 19:00 UTC Rennes vs. Paris FC Predicted outcome: Rennes✅ Predicted score: 2:1 Actual: Rennes 2:1 #Rennes#ParisFC 2026-05-10 19:00 UTC Toulouse vs. Lyon Predicted outcome: Lyon❌ Predicted score: 1:2 Actual: Toulouse 2:1 #Toulouse#Lyon 2026-05-10 19:00 UTC Auxerre vs. Nice Predicted outcome: Auxerre✅ Predicted score: 2:1 Actual: Auxerre 2:1 #Auxerre#Nice 2026-05-10 19:00 UTC Le Havre vs. Marseille Predicted outcome: Le Havre❌ Predicted score: 2:1 Actual: Marseille 0:1 #LEHavre#Marseille 2026-05-10 19:00 UTC Metz vs. Lorient Predicted outcome: Lorient✅ Predicted score: 1:2 Actual: Lorient 0:4 #Metz#Lorient #Football#FranceLigue1