Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
Systematic expulsion of #Alawites from north Hama countryside by Sharaa government. Reallocation of #Syria land.
Excellent Report By Bashir Ghadir
1. 12 Alawite Villages near Hama, Syria have been emptied of their inhabitants.
2. HTS expelled the villagers and offered their lands to investors through a corporation connected to the governorate. The investors get 40% of the profits. The state gets 60%.
3. Alawites tried to come back to their land, but the local authorities told them they could not guaranty their safety. The Alawite farmers were informed that their lands had been appropriated by the `Iktifa' corporation.
4. The same thing is happening in the countryside of Latakia and Homs.
https://youtu.be/5BX7OgmDsmA?si=ZNJeTxDPv0hEJjqG via
@YouTube
Exactly a year ago, this is how easy it was for them to kill old men just for being #Alawites. This is the result of more than a decade of incitement against our sect mainly by Qatar and their Muslim brotherhood.
Why? Because it's too hard for their Islam to accept another faith. Until this very day, the media calls Alawites the #Assad sect whenever a massacre is being mentioned. Assad and his majority Sunni army fled or joined the new terrorist regime long ago, while civilian Alawites are still being oppressed with media cover up.
In #Jolani's textbook, you disperse peaceful protesters by bringing FUCKING TANKS.
@TheAlawiteEcho
Tens of thousands of #Alawites are protesting in the city of #Latakia and all around the Syrian coast, rejecting the Jihadist regime of #Jolani, calling for federalism.
The Alawite community has lost thousands of civilians throughout the last year, with thousands more detained. https://t.co/SV7Sb1byDR
View tweet
"Syria Al-Julani regime released kidnapped Druze kids after months of detention
The Jolani regime has released two Druze brothers, Yanal Bashar al-Haddad (15) and Qais Bashar al-Haddad (13), who had been detained at Adra Prison in #Damascus since their arrest during the attack on #Suwayda on July 15, 2025.
Its worth noting that terriost regime kidnapped and killed a lot of Druze and Alawites kids and women (see links on X post)
❗️ Note that the terrorist regime refuse to hold accountable the militants who committed massacres against the #Alawites or #Druze, and label them as “mojahdin” =jihadists, because fighting against “infidel” minorities is considered a heroic act in their eyes."
https://x.com/SyJusticeArc/status/2006461460713488503
Thousands of #Alawites take to the streets in unprecedented protests across #Syria, sparked by allegations of a shrine attack and escalating violence. Clashes, a fatality, and curfews mark the country’s most significant unrest in years.
#Syria2024#MiddleEast#SyriaProtests
"A new massacre against the #Alawites in the city of #Latakia, in the #Dattour neighborhood, al-Mazar junction.
I beg all segments of the Syrian people, especially the #Druze, #Kurds, and any remaining members of the #Sunni community who still have a little humanity left in their hearts, to take to the streets in protest to stop these massacres against the innocent. These #massacres are not from yesterday, they are happening today, and as of moments ago, they are still being carried out by Syrian members of Hay’at Tahrir al-Sham #HTS, wearing their official uniforms.
Please, save those who remain."
https://t.me/CoastSyrian24/771