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

Резултати

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

Пребарај: #biсonomyexchange

当前筛选 #biсonomyexchange清除筛选
Airdrop3 LTD

@airdrop3ltd · Post #201 · 04.09.2021 г., 19:31

🔥🔥🔥🔥🔥🔥🔥🔥 🚀IT’S STARTED🚀 💎JOIN NOW💎💸💰 Take part in epic #BIT Airdrop from #BiсonomyExchange🚀 💎@CoinMarketCap Supported JOIN HERE:https://coinmarketcap.com/currencies/biconomy-token/airdrop/ 💎10,000 winners will share a reward of $ 50,000 in BIT Tokens 💎Airdrop dates from 03/09 to 23/09/2021 ✅COMPLETE ALL taskshttps://biconomy.zendesk.com/hc/en-us/articles/4405873367193--50-000-Airdrop-Campaign-for-Biconomy-Exchange-Token-BIT-Launchand fill out the formhttp://shorturl.at/jnxyV 🔥BIT TOKEN will be listed 06/09/2021 on PANCAKESWAP🚀 ❗️All malicious and cheating activities during airdrop campaign - registration from one IP, creation of multi-accounts, will be identified and persons who have committed malicious actions will be excluded from the airdrop distribution lists❗️

Bounty Hunters 💎

@trustedairdropsss · Post #2476 · 07.09.2021 г., 12:15

🔥🔥🔥🔥🔥🔥🔥🔥 🚀IT’S STARTED🚀 💎JOIN NOW💎💸💰 Take part in epic #BIT Airdrop from #BiсonomyExchange🚀 💎@CoinMarketCap Supported JOIN HERE: https://coinmarketcap.com/currencies/biconomy-token/airdrop/ 💎10,000 winners will share a reward of $ 50,000 in BIT Tokens 💎Airdrop dates from 03/09 to 23/09/2021 ✅COMPLETE ALL tasks https://biconomy.zendesk.com/hc/en-us/articles/4405873367193--50-000-Airdrop-Campaign-for-Biconomy-Exchange-Token-BIT-Launch and fill out the form http://shorturl.at/jnxyV 🔥BIT TOKEN will be listed 06/09/2021 on PANCAKESWAP🚀 ❗️All malicious and cheating activities during airdrop campaign - registration from one IP, creation of multi-accounts, will be identified and persons who have committed malicious actions will be excluded from the airdrop distribution lists❗️