@dragonarmor · Post #293 · 01.02.2022 г., 03:49
#mecha#dragon https://twitter.com/BastionBitch/status/1487975299568455682
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
Пребарај: #mecha
@dragonarmor · Post #293 · 01.02.2022 г., 03:49
#mecha#dragon https://twitter.com/BastionBitch/status/1487975299568455682
@SeriesClubHD · Post #2974 · 12.05.2026 г., 17:00
📺 - CODE GEASS - 📺 Título Original: Code Geass: Lelouch of the Rebellion Título Original: Code Geass: Lelouch el de la Rebelión Género:#Mecha#Acción#Drama#Política#CienciaFicción Temporadas: 2 📼 Año: 2006 - 2008 Origen: Japón 🇯🇵 Tráiler:youtu.be/2WaWhXoBNcc Saga:Sí✅ Sinopsis: En un mundo dominado por el Imperio de Britannia, Lelouch Lamperouge obtiene el poder del “Geass”, que le permite controlar a cualquiera con una orden. Con este don, decide liderar una rebelión contra el imperio, enfrentando dilemas éticos, batallas épicas y el peso de sus decisiones en la lucha por la libertad. Disponible:Crunchyroll | Netflix @SeriesClubHD
@dragonarmor · Post #207 · 13.06.2021 г., 06:41
#index#mecha#anthro https://twitter.com/protoBASILISK/status/1402058879048073216/photo/1
@dragonarmor · Post #193 · 07.06.2021 г., 07:25
#index#mecha#anthro https://twitter.com/Zhek0_AD/status/1350233869702885384?s=19
@dragonarmor · Post #192 · 07.06.2021 г., 07:25
#index#mecha#anthro https://twitter.com/Zhek0_AD/status/1353332425909272576?s=19
@dragonarmor · Post #139 · 14.04.2021 г., 10:52
#index#anthro#mecha https://twitter.com/Zhek0_AD/status/1372206622097948678?s=19
@dragonarmor · Post #127 · 04.04.2021 г., 13:55
#index#anthro#mecha https://e621.net/posts/2412194
@dragonarmor · Post #111 · 21.03.2021 г., 13:06
#index#mecha#anthro https://twitter.com/ishibashiyosuke/status/1373235200264605700?s=19
@dragonarmor · Post #99 · 12.03.2021 г., 08:34
#index#anthro#mecha https://www.pixiv.net/artworks/58797464
@dragonarmor · Post #97 · 12.03.2021 г., 08:34
#index#anthro#mecha https://twitter.com/NkmR8/status/1369277952010031113/photo/1
@dragonarmor · Post #83 · 27.02.2021 г., 13:54
#index#mecha#anthro https://twitter.com/jyabaryu/status/1357393843562237953/photo/1
@dragonarmor · Post #81 · 27.02.2021 г., 13:51
#index#mecha#anthro https://e621.net/posts/1075082