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

Резултати

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

Пребарај: #akron

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

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

Russia Premier League🇷🇺 2026-05-03 11:30 UTC FC Sochi vs. FC Orenburg Predicted outcome: FC Orenburg❌ Predicted score: 1:2 Actual: FC Sochi 3:1 #FCSochi#Orenburg 2026-05-03 14:00 UTC Akron vs. FC Krasnodar Predicted outcome: FC Krasnodar✅ Predicted score: 1:2 Actual: FC Krasnodar 0:1 #Akron#Krasnodar 2026-05-03 16:30 UTC Akhmat vs. Nizhny Novgorod Predicted outcome: Akhmat✅ Predicted score: 2:1 Actual: Akhmat 2:0 #Akhmat#NizhnyNovgorod #Football#RussiaPremierLeague

AI match predictions

@ai_match_prediction · Post #11676 · 23.04.2026 г., 09:05

Russia Premier League🇷🇺 2026-04-23 14:30 UTC Akron vs. Dinamo Makhachkala Predicted outcome: Akron❌ Predicted score: 1:0 Actual: Draw 1:1 #Akron#DinamoMakhachkala 2026-04-23 16:45 UTC Spartak Moscow vs. FC Krasnodar Predicted outcome: Draw❌ Predicted score: 2:2 Actual: FC Krasnodar 1:2 #SpartakMoscow#Krasnodar 2026-04-23 16:45 UTC Akhmat vs. Baltika Predicted outcome: Baltika❌ Predicted score: 0:1 Actual: Draw 1:1 #Akhmat#Baltika #Football#RussiaPremierLeague

AI match predictions

@ai_match_prediction · Post #12039 · 11.05.2026 г., 05:05

Russia Premier League🇷🇺 2026-05-11 10:00 UTC Akron vs. FC Rostov Predicted outcome: FC Rostov✅ Predicted score: 1:2 Actual: FC Rostov 1:3 #Akron#Rostov 2026-05-11 12:15 UTC Nizhny Novgorod vs. CSKA Moscow Predicted outcome: CSKA Moscow✅ Predicted score: 1:2 Actual: CSKA Moscow 1:2 #NizhnyNovgorod#CSKA 2026-05-11 14:30 UTC Spartak Moscow vs. Rubin Predicted outcome: Spartak Moscow✅ Predicted score: 2:1 Actual: Spartak Moscow 2:1 #SpartakMoscow#Rubin 2026-05-11 17:00 UTC Dynamo vs. FC Krasnodar Predicted outcome: FC Krasnodar❌ Predicted score: 1:2 Actual: Dynamo 2:1 #DynamoMoscow#Krasnodar #Football#RussiaPremierLeague

AI match predictions

@ai_match_prediction · Post #11556 · 18.04.2026 г., 01:05

Russia Premier League🇷🇺 2026-04-18 09:00 UTC FC Orenburg vs. Lokomotiv Predicted outcome: Draw❌ Predicted score: 2:2 Actual: Lokomotiv 0:1 #Orenburg#Lokomotiv 2026-04-18 11:30 UTC Krylia Sovetov vs. CSKA Moscow Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #KryliaSovetov#CSKA 2026-04-18 14:00 UTC Rubin vs. Akron Predicted outcome: Rubin❌ Predicted score: 2:1 Actual: Draw 1:1 #Rubin#Akron 2026-04-18 16:30 UTC Nizhny Novgorod vs. Dynamo Predicted outcome: Dynamo❌ Predicted score: 1:2 Actual: Draw 1:1 #NizhnyNovgorod#DynamoMoscow #Football#RussiaPremierLeague

AI match predictions

@ai_match_prediction · Post #11272 · 04.04.2026 г., 05:05

Russia Premier League🇷🇺 2026-04-04 10:00 UTC Akron vs. CSKA Moscow Predicted outcome: Draw❌ Predicted score: 1:1 Actual: CSKA Moscow 1:2 #Akron#CSKA 2026-04-04 12:15 UTC Zenit vs. Krylia Sovetov Predicted outcome: Zenit✅ Predicted score: 3:0 Actual: Zenit 2:1 #Zenit#KryliaSovetov 2026-04-04 14:30 UTC Dynamo vs. FC Orenburg Predicted outcome: Dynamo❌ Predicted score: 2:1 Actual: Draw 3:3 #DynamoMoscow#Orenburg 2026-04-04 16:45 UTC Akhmat vs. FC Krasnodar Predicted outcome: Draw❌ Predicted score: 1:1 Actual: FC Krasnodar 0:1 #Akhmat#Krasnodar #Football#RussiaPremierLeague

AI match predictions

@ai_match_prediction · Post #11141 · 22.03.2026 г., 05:05

Russia Premier League🇷🇺 2026-03-22 10:45 UTC FC Orenburg vs. Spartak Moscow Predicted outcome: Draw❌ Predicted score: 2:2 Actual: Spartak Moscow 0:2 #Orenburg#SpartakMoscow 2026-03-22 13:00 UTC Dynamo vs. Zenit Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Zenit 1:3 #DynamoMoscow#Zenit 2026-03-22 13:30 UTC Krylia Sovetov vs. Rubin Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 0:0 #KryliaSovetov#Rubin 2026-03-22 16:00 UTC Lokomotiv vs. Akron Predicted outcome: Lokomotiv✅ Predicted score: 2:1 Actual: Lokomotiv 5:1 #Lokomotiv#Akron #Football#RussiaPremierLeague