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

Резултати

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

Пребарај: #inline

当前筛选 #inline清除筛选
BotsGram®

@botsgram_cu · Post #4544 · 08.12.2021 г., 16:14

@ShrugEmojiBot ¿Qué puede hacer este bot? Úsalo de manera inline (@ del bot en cualquier chat) para enviar el emoticono de una persona encogiendose de hombros (Visto en @BotsGram_cu) #inline

Hashtags

BotsGram®

@botsgram_cu · Post #3344 · 30.12.2020 г., 12:01

@WiseInfoBot Qué puede hacer este bot? Con este bot puedes obtener información sobre una cuenta de telegram, reenviándole un mensaje o escribiendo un nombre de usuario . También funciona inline Idioma: Inglés (visto en @BotsGram_cu) #inline

Hashtags

Bots Channel

@BotsChannel · Post #145 · 19.01.2016 г., 20:46

🏆BOT OF THE DAY🏆 Amazon Inline Search @azonbot ⭐️⭐️⭐️⭐️⭐️ 👥 (20) This Amazon search bot automatically works in all your chats and groups, no need to add it anywhere. #Utilities#inline http://botsfortelegram.com/project/azonbot-amazon-search-inline/

Resource.rs

@resource_rs_channel · Post #4112 · 17.02.2022 г., 02:20

[Reddit] Why derive(Copy, Clone) is different with derive(Clone) + impl Copy Hi, I've encountered an unexpected but explainable case, that #derive(Clone) enum A { A = 1, B = 2, C = 3, } impl Copy for A {} #derive(Clone, Copy) enum B { A = 1, B = 2, C = 3, } Expanded code as impl ::core::clone::Clone for A { #inline fn clone(self: &Self)

BotsGram®

@botsgram_cu · Post #3785 · 07.04.2021 г., 10:00

@traduciendobot Qué puede hacer este bot? Este es un bot traductor que trabaja con cualquier idioma. También trabaja inline y podes agregarlo a grupos. Idioma: Español (visto en @BotsGram_cu) #inline, #translate

BotsGram®

@botsgram_cu · Post #3262 · 08.12.2020 г., 04:02

@utubebot Qué puede hacer este bot? Este bot es el mejor descargador de video con soporte de conversión de MP3. Para buscar videos, use el modo en línea @utubebot. 🤠 Idioma: Inglés (visto en @BotsGram_cu) #download, #youtube, #inline

BotsGram®

@botsgram_cu · Post #4488 · 15.11.2021 г., 13:16

¿Qué puede hacer este bot? @CalcIt_bot Calculadora simple con botones integrados. También se puede usar de manera #inline. Idioma: Inglés (Visto en @botsgram_cu) #calculadora

BotsGram®

@botsgram_cu · Post #4559 · 19.12.2021 г., 04:42

@spoilerobot ¿Que puede hacer este bot? Le permite enviar mensajes spoiler de forma #inline en chats, de forma que los demás usuarios decidan si quieren verlo o no Idioma: Inglés (Visto en @BotsGram_cu) Gracias a @Black_Drako por el aporte. #spoiler

BotsGram®

@botsgram_cu · Post #3476 · 06.02.2021 г., 11:25

@bgcolorBot Qué puede hacer este bot? Este bot puede generar un color aleatorio para ser utilizado como fondo para Telegram. Idioma: Inglés (visto en @BotsGram_cu) #inline, #background

ПретходнаСтраница 1 од 4Следна