Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
🎙President Vladimir Putin congratulated Russian women on International Women’s Day (March 8, 2026)
On March 7, Russia's President held a meeting at the Kremlin with women serving the Motherland on the front lines and beyond – military personnel, doctors, war correspondents, artists & professionals from across the country.
💬 Vladimir Putin: We always celebrate this holiday with the warmest and most heartfelt feelings.
We admire our wonderful women and express our love, appreciation and gratitude from the bottom of our hearts.
Women make the world better and kinder with their generosity, compassion and genuine female wisdom. A mother’s love remains in every person’s heart for a lifetime – it warms us, multiplies our joyful emotions and gives us strength in the most difficult moments.
There are no heights beyond the reach of our women. You achieve remarkable success in many different professions. And when circumstances demand it – you demonstrate exceptional resilience, determination and strong leadership.
You never hesitate to help those who need your assistance, surrounding your families and loved ones with care and attention and dedicating yourselves to educating children.
Of course, managing to strike us with your beauty and charm while doing hard work, showing commitment and stamina is a formidable task, but you have succeeded in it.
It is essential that we recognise and understand this. As for us, we reaffirm our commitment to create all the necessary conditions, both at the state level and, no doubt, in our families to enable women to strike a balance between motherhood and professional excellence, empowering them to fulfil their potential so that they do not have to wait too long before they can experience the joy of having a family, becoming a spouse and a mother.
On a special note, I would like to congratulate women who are performing their duties in the special military operation zone and are facing extreme hardship while working in Donbass and Novorossiya and in our border regions. Wherever you find yourselves, you have been demonstrating valour and courage, selflessness and strength of spirit. You have my sincere and heartfelt gratitude for that.
Dear women,
The sky is the limit for you. You are sources of creation and development, and you combine resilience with tenderness. Your commitment to create a better future for your children inspires all of us to keep moving forward.
I wish you happiness with those dear to you, success in everything that matters to you, and sound health and well-being to you and your loved ones.
💐Happy holiday! Happy International Women’s Day!
#InternationalWomensDay#March8
🎙President Vladimir Putin congratulated Russian women on International Women’s Day (March 8, 2026)
On March 7, Russia's President held a meeting at the Kremlin with women serving the Motherland on the front lines and beyond – military personnel, doctors, war correspondents, artists & professionals from across the country.
💬 Vladimir Putin: We always celebrate this holiday with the warmest and most heartfelt feelings.
We admire our wonderful women and express our love, appreciation and gratitude from the bottom of our hearts.
Women make the world better and kinder with their generosity, compassion and genuine female wisdom. A mother’s love remains in every person’s heart for a lifetime – it warms us, multiplies our joyful emotions and gives us strength in the most difficult moments.
There are no heights beyond the reach of our women. You achieve remarkable success in many different professions. And when circumstances demand it – you demonstrate exceptional resilience, determination and strong leadership.
You never hesitate to help those who need your assistance, surrounding your families and loved ones with care and attention and dedicating yourselves to educating children.
Of course, managing to strike us with your beauty and charm while doing hard work, showing commitment and stamina is a formidable task, but you have succeeded in it.
It is essential that we recognise and understand this. As for us, we reaffirm our commitment to create all the necessary conditions, both at the state level and, no doubt, in our families to enable women to strike a balance between motherhood and professional excellence, empowering them to fulfil their potential so that they do not have to wait too long before they can experience the joy of having a family, becoming a spouse and a mother.
On a special note, I would like to congratulate women who are performing their duties in the special military operation zone and are facing extreme hardship while working in Donbass and Novorossiya and in our border regions. Wherever you find yourselves, you have been demonstrating valour and courage, selflessness and strength of spirit. You have my sincere and heartfelt gratitude for that.
Dear women,
The sky is the limit for you. You are sources of creation and development, and you combine resilience with tenderness. Your commitment to create a better future for your children inspires all of us to keep moving forward.
I wish you happiness with those dear to you, success in everything that matters to you, and sound health and well-being to you and your loved ones.
💐Happy holiday! Happy International Women’s Day!
#InternationalWomensDay#March8
💎Aziz va qadrli ayollar!
💐8 mart – Xalqaro xotin-qizlar kunibilan sizlarni samimiy muborakbod etamiz!
🌸Siz – hayotimizning fayzi, oilalarimizning tayanchi, jamiyatimizning ilhom manbaisiz.
🎀Sizga mustahkam sog‘lik, cheksiz baxt, qalbingizga xotirjamlik va ezgu orzularingiz ro‘yobini tilaymiz. Har bir kuningiz mehr-muhabbat, e’tibor va e’tirofga to‘la bo‘lsin. Yuzingizdan tabassum, qalbingizdan quvonch arimasin!
Samimiy hurmat bilan,
Biznes va tadbirkorlik oliy maktabi
__________
💎Дорогие и уважаемые женщины!
💐 Поздравляем вас с Международным женским днём – 8 Марта!
🌸Вы – украшение нашей жизни, опора наших семей и источник вдохновения для всего общества.
🎀Желаем вам крепкого здоровья, безграничного счастья, душевного спокойствия и исполнения самых светлых мечтаний. Пусть каждый ваш день будет наполнен любовью, вниманием и признанием. Пусть улыбка не сходит с вашего лица, а радость всегда живёт в вашем сердце!
С искренним уважением,
Высшая школа бизнеса и предпринимательства
#GSBE#GraduateSchool#March8#HappyWomensDay
🔝Web-site |🔝Facebook | 🔝Instagram | 🔝Youtube
International Women’s Day at the Russian House Brussels
On the occasion of International Women’s Day, the Russian House Brussels is pleased to invite you to a series of cultural events dedicated to women — their dignity, strength and enduring inspiration.
🌸Concert “She Connects Worlds”
📅 5 March | 19:00–21:00 | Free admission
Registration:
https://rushouse.be/event/concert-she-connects-worlds/
🌷Concert dedicated to March 8 “Mother, Wife and Sister”
📅 12 March | 19:00–20:30
Registration:
https://rushouse.be/event/concert-dedicated-to-march-8-mother-wife-and-sister/
The programme will feature music and poetry, highlighting the richness of cultural traditions and paying tribute to the role of women in family, society and the arts.
We look forward to welcoming you to the Russian House Brussels for these special evenings.
📍 Russian House Brussels
Registration is required.
#InternationalWomensDay#March8#RussianHouseBrussels#Culture
This morning started with flowers from my friends — they left a bouquet by my door while I was still sleeping. A little miracle that set the mood for the whole day.
#LunaEverly#March8#WomensDay#Flowers#Holiday#Spring
🌸 Мимоза – аромат весны и нежности! 🌸
Какой цветок первым приходит на ум, когда говорят о 8 Марта? Конечно, мимоза! ☀️ Её золотистые пушистые цветы источают сладковато-медовый аромат с лёгкими зелёными нотами – как предчувствие тепла, солнца и обновления.
✨ Аромат месяца – «Мимоза» от BAGO home! ✨
Весь март -20% на всю коллекцию:
💛 Аромадиффузоры (50 и 100 мл)
💛 Наполнители (рефиллы) 200 мл
💛 Аромаспреи 100 мл
💛 Аромасаше
💛 Свечи из соевого воска (40 часов горения)
Наполните дом атмосферой цветущего сада! 🌿💛
Заказывайте на нашем сайте 🌸
#BAGOhome#Мимоза#АроматВесны#ПодарокК8Марта#ВесеннееНастроение#СимволВесны#АроматМесяца#АроматДляДома#Аромасвечи#Аромадиффузор#SoyCandles#HomeFragrance#SpringScent#GiftForHer#March8#SpringMood#Discount