Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
🚀 Economist Win Thin Reflects on Global CPI Trends
Economist Win Thin has observed that, in retrospect, the Consumer Price Index (CPI) data for March in most countries worldwide was slightly below expectations, with the exception of the United States. According to Jin10, many other countries are increasing fuel subsidies to alleviate the impact on consumers. However, Thin warns that this approach may lead to significant fiscal burdens, making it unsustainable in the long term.
#Economist#CPI#GlobalTrends#FuelSubsidies#FiscalBurden#Inflation
🌍 One question. Global consequences.
Will Russia and Ukraine reach a ceasefire by March 31, 2026?
Diplomacy, pressure, fatigue — or escalation?
Drop your take 👇
https://edgemarket.ai/bnb/social-media/Russia%20x%20Ukraine%20ceasefire%20by%20March%2031,%202026/statistics/69830479ff612403d86bf273
#Geopolitics#Ceasefire#WorldNews#GlobalTrends#ConflictAnalysis#FutureEvent
#The_Fortune🇺🇸📕[PDF]⬇️
#December2025
#January2026
#Monthly_Magazines
For learning, for free(dom).
@backupofmagazines
Global coverage this week tracks how rising tech power reshapes markets and geopolitics as China accelerates drug manufacturing, automation and green innovation with implications for global supply chains amid growing #Geopolitics tension. U.S. markets confront an expanding #AI boom, from Anthropic’s trust-first model to questions around Nvidia’s dominance, while investors chase new strategies in an increasingly volatile #MarketWatch environment. Culture and consumer shifts surface in Roblox’s evolution, the booming beauty sector and wellness travel trends. Meanwhile climate action, urban sustainability and energy transitions intensify worldwide under mounting #ClimateCrisis pressure, defining a rapidly changing global landscape shaped by #GlobalTrends.
#The_Barron's 🇺🇸📕[PDF]⬇️
24 #November2025
#Weekly_Magazines
For learning, for free(dom).
@backupofmagazines
Europe’s renewed market momentum anchors this Barron’s issue, where analysts see brighter days ahead amid rising profits and shifting geopolitics—an outlook shaped by #MarketWatch forces and #GlobalTrends. Nvidia’s strong guidance fuels confidence in the #AI boom, even as investors navigate #Volatility across equities and buffer ETFs. Caution rises around India’s IPO wave, reinforcing a broader #RiskManagement mindset. With bond vigilantes returning and central-bank uncertainty growing, the magazine highlights why disciplined strategy remains essential in today’s #Finance landscape.
#The_Science🇺🇸📕[PDF]⬇️
13 #November2025
#Weekly_Magazines
For learning, for free(dom).
@backupofmagazines
This issue dives into breakthroughs reshaping biology and energy as researchers confront rising geopolitical limits. From #AI-driven epigenetics to #SyntheticBiology advances, the issue tracks how innovation pushes ahead despite tensions over China-US research ties. New micro-robots navigating the bloodstream and faster-charging batteries highlight a surge in #DeepTech momentum. Climate resilience, #PandemicPreparedness, and EU chemical reforms underscore global policy stakes. Studies on dog domestication, brown dwarfs, and marine recovery after extinction broaden the scientific lens. A reminder that #ScienceMatters even as politics shift—innovation continues to define our shared future. #TechNews#GlobalTrends#ResearchUpdates
#The_National_Geographic🇺🇸📕[PDF]⬇️
#November2025
#Monthly_Magazines
For learning, for free(dom).
@backupofmagazines
This issue tours big frontiers: a colossal #NuclearFusion tokamak in France promises star power on Earth; botanists curate the world’s deadliest garden; a teenage Sherpa resets who belongs on alpine peaks; macro art peers through a bug’s eye; new science reframes adult #ADHD; crested gibbons show robotlike dances; wildfire imagery from the #SierraNevada; archaeologists ink themselves to decode ancient tattoos; and medics test human hibernation for deep-space care. Essential reading for explorers and pragmatists alike. #NationalGeographic#Climate#Energy#Biodiversity#Wildfire#Photography#Neuroscience#Space#Innovation#Science#Sustainability#Tokamak#Fusion amid accelerating #AI research and #GlobalTrends, shaping tomorrow’s decisions.