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

Пребарај: #voltageos

当前筛选 #voltageos清除筛选
Xiaomi 12T Pro | K50U | Updates

@xiaomi_12tpro_updates · Post #317 · 29.04.2025 г., 06:36

¡New build available! #A15#voltageOS Device: Xiaomi 12T Pro/ Redmi K50 Ultra (diting) Version: 4.3 Download: here Changelog: - Initial A15 QPR2 release - Oss Kernel if you like my work and want to support it please consider making a donation this helps with download server costs and buy a soda!. Donate: paypal

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #660 · 11.08.2025 г., 15:43

VoltageOS - Unofficial | A15 | Nothing Phone 2 (Pong) 📝Details: - Version: v4.5 - Device: #Pong - Type: #Vanilla - Released: 11/08/25 ⬇️Download: Here | Mirror 📖Changelogs: Initial Build 📔Instructions: Here 🖼Screenshots : Here 🆘 Support : Here 🏷Tags: #AOSP#ROM#VoltageOS#Sandboxing#Unofficial ✍️ Note: • Base firmware 3.0 is recommended. • If you face any bugs, report with logs. • GrapheneOS Appstore : Here • Working Dolby : Here • Meteoric kernel baked in with KSUN 1.0.8 + SUSFS prepatched. • This is the first-ever public release build by the maintainer stepping into ROM building. Feedback is much appreciated! 🏆 Credits: - Built based on Ghosuto's Device Tree - Hellboy for Meteroic kernel - Pong Dev Team & MrDeath - Fabian and Hellboy for Glyph Implementation 👤 Maintainer: @kaushikieeee 🔔Updates: @NothingPhone2Updates 🐙Chat: @NothingPhone2

Xiaomi 12T Pro | K50U | Updates

@xiaomi_12tpro_updates · Post #456 · 21.10.2025 г., 01:50

#Voltageos#AOSP#UNOFFICIAL#A16#BKA#Diting Voltage OS UNOFFICIAL V5.2 | A16 Released: 20/10/2025 Download : SF | Mirror Screenshots : Here Changelog : Here Support:Group Changelogs: • Initial build • Hyper Camera by default • Dolby Audio by default • Support KernelSU Notes: If you want to receive regular updates, you can donate and we will add you to VIP support. Credits:Here By@Jezzay97 | Donate Follow@xiaomi_12tpro_updates Join@xiaomi12tpro_chat