Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в Python в модуле re.
Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки.
pattern = re.compile(r"(\w+)+")
words = pattern.search(text, re.DOTALL)
А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как.
pattern.search(text, re.DOTALL | re.VERBOSE)
А теперь смотрим исходники, что находится в этих атрибутах?
Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево.
>>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]:
>>>
print(bin(n))
0b1
0b10
0b100
0b1000
0b10000
0b100000
0b1000000
0b10000000
0b100000000
Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули:
000000001
000000010
000000100
000001000
000010000
000100000
001000000
010000000
100000000
Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45
В общем, это пример применения побитовых операций в самом Python.
Теперь вы знаете Python еще немного лучше)
#tricks#regex#libs
🚀 Gas-Free Transfers are now live on Solana!
With TokenPocket, enjoy:
✨ 3 free transfers every day
✨ Fast, reliable on-chain transactions
Make every move cost-effective with #GasFreeWallet💙
→ https://help.tokenpocket.pro/en/wallet-faq-en/solana-wallet/gas-free-service-on-solana
⛽️Gas Fee? Gas Free!
No more worrying about running out of $TRX for gas fees — TokenPocket now supports $USDD for gas payments, with a limited-time subsidy!
Enjoy a smoother, faster, and more efficient experience on the TRON network. #StablecoinWallet#GasFreeWallet
🎥 Watch how it works: https://youtube.com/watch?v=gndDfJBN_cg
🔋Gas-Free Stablecoin Transfers? TokenPocket makes it real.
→ https://help.tokenpocket.pro/en/wallet-operation/stablecoin/gas-free
✅Zero fees, lightning-fast transactions on BNBCHAIN & TRON
✅Trusted by 30M+ users worldwide - fast, affordable, secure.
Experience the future of stablecoin wallets with TokenPocket. #StablecoinWallet#GasFreeWallet
📝 TokenPocket Monthly Report — December 2025
→ https://tokenpocket-gm.medium.com/tokenpocket-monthly-report-december-2025-c0cd0518efa7
In December, TokenPocket launched a series of measures under the theme of technological innovation and community activities, covering multiple dimensions such as multi-chain function upgrades, trading experience, ecosystem cooperation expansion, security protection enhancements, and transfer experience optimization.
🎯#SAFU
TokenPocket's anti-phishing function is comprehensive. Combined with security functions like Privacy Wallet and Passphrase, it jointly safeguards the security of your assets.
🎯#StablecoinWallet & #GasFreeWallet
TokenPocket now supports Multi-Chain Gas Payment with Stablecoins on base, arbitrum, and BNBCHAIN. Combined with 0 gas fee transfers services on trondao, solana, and BNB Chain, this further solidifies TokenPocket as your go-to choice for a Stablecoin Wallet.
📍 All In One, All in TokenPocket
https://t.co/OVU2yXAPqA
🟥The Gas-Free Transfer on TRON on TokenPocket is live! 🍌
😍Get your TRON Gas Coupons NOW!
✅Comment [Gas-Free On TokenPocket] below👇
💰For 100 winners!
💎With TokenPocket’s TRON Gas Coupons, you can save up to 100% on gas costs on the TRON Network, allowing you to enjoy truly GAS-FREE transfers and trading experiences on TRON!
Details👉https://help.tokenpocket.pro/en/wallet-faq-en/tron-wallet/coupon
#TRON#TokenPocket#GasFree#ZeroGas#GasFreeWallet