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

Резултати

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

Пребарај: #bnbet

当前筛选 #bnbet清除筛选
BNBet

@bnbetofficial · Post #39 · 14.10.2025 г., 16:37

BNBET AMA Recap & Next Plans New milestone reached — 10.86M MCAP. Here’s everything we talked about during our recent AMA, from what’s been done so far to what’s coming next for BNBET. Here’s what we’ve accomplished so far: - Released a new feature called Polybets - AVE listed - Expanded to the Chinese community - More KOLs onboarding - CMC application submitted BNBet keeps moving forward fast. Next up for BNBet: - UI/UX upgrade for a smoother experience - Vault escrow integration (trusted 3rd-party) to build more trust - Full BNBet platform integration for seamless access - Upcoming collaboration and partnership We keep moving, we keep building, we keep delivering. #BNBET#BNB

Hashtags

BNBet

@bnbetofficial · Post #8 · 10.10.2025 г., 12:21

Security first. Always. 🔶 $BNBet security is powered by @Privy_io , so your funds stay safe while you play, predict, and win. Bet smart. Stay secure. #BNBet#BNB

Hashtags

BNBet

@bnbetofficial · Post #22 · 10.10.2025 г., 16:17

Our tokens are officially locked 🔒 We’re here to build long-term, not short-term hype. https://bscscan.com/tx/0x6d71cac9d7d9f2c7516f2ee5ad421d0942b475d9481ecdff3bb7707162f83749 #BNBet#BNBChain

BNBet

@bnbetofficial · Post #5 · 10.10.2025 г., 09:27

$BNBet Whitepaper is out now 🔥 We’re building a fully onchain Betting market on BNB, simple, transparent, and for everyone. Would love your feedback 👇 Read it here: https://bnbet.gitbook.io/whitepaper #BNBChain#BNBet#KeepBuilding