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

Пребарај: #telescope

当前筛选 #telescope清除筛选
Universe Mysteries 🪐

@cosmomyst · Post #362 · 02.10.2025 г., 15:21

🪐 The James Webb Space Telescope has revealed that the galaxy GS-9209, located over 12 billion light-years away, experienced a massive burst of star formation before suddenly becoming dormant just 800 million years after the Big Bang. This galaxy’s abrupt transition from a stellar nursery to a cosmic "ghost town" challenges ideas about how quickly galaxies could form and shut down in the early universe. ✨ #galaxies⚡#webb⚡#telescope⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

科技&趣闻&杂记

@kejiqu · Post #4280 · 21.03.2026 г., 00:43

哈勃太空望远镜意外捕捉彗星 C/2025 K1 (ATLAS) 瓦解过程 NASA 的哈勃太空望远镜意外观测到彗星 C/2025 K1 (ATLAS) 瓦解。该彗星在绕太阳运行并开始离开太阳系的过程中被观测到。哈勃太空望远镜在彗星 K1 距离太阳最近的一个月后,捕捉到了其解体的图像。Space.com 🏷#Hubble#Space#Telescope#C#K1#ATLAS#NASA 📢频道👥群组📝投稿

BotsGram®

@botsgram_cu · Post #3161 · 25.11.2020 г., 07:33

@TelescopyBot Qué puede hacer este bot? Con este bot puedes convertir videos cuadrados a videos redondos Idioma: Inglés, Ruso (visto en @BotsGram.cu) #telescope, #video_\message, #convert, #mp4, #gif, #media, #questions, #command, #round, #message, #video