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

Пребарај: #hodlers

当前筛选 #hodlers清除筛选
Morningstar Ventures (News & Announcements)

@morningstar_ventures · Post #71 · 24.03.2022 г., 16:14

The EGLD Community Platform Goes Live 💫 We have been Elrond community members (and #hodlers) for a long time already and deeply care about the Elrond ecosystem. Today we are announcing the launch of a product we have been working on behind the scenes for quite some time and will hopefully add a lot of value to the Elrond ecosystem. Meet the "EGLD Community" - a social platform to discover, learn and talk about all-things Elrond! Discover more and sign up here: ➡️https://bit.ly/36ILzfM

Hashtags

DWF Labs Broadcast

@Dwflabs · Post #185 · 28.01.2023 г., 05:29

BIT x DWF Labs Crypto Snapshot [27 Jan] 📰 Highlights: 🔸 Diamond Hands Rule The Charts As #Bitcoin#HODLers Continue To Hold Despite Gains 🔸 The Open Network Move Towards Utility By Suspending Inactive Wallets 🔸 CRV Liquidity Providers Hungry For More Options Full read here.

SIGNAL

@finsignal · Post #3408 · 24.07.2024 г., 11:08

🥸 Above is a 10-year chart of significant #altcoins and the number of non-empty wallets (#hodlers) in the corresponding networks: #Litecoin: 8.08M wallets #Dogecoin: 6.69M wallets #XRP Ledger: 5.24M Wallets #Cardano: 4.48M Wallets #Shiba Inu: 1.39M wallets #Chainlink: 722K wallets