Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
News: Over Birr 2.2 million seized in #Shire as authorities warn against illegal lending amid cash shortages
Authorities in Shire Endaselassie city in the Northwestern Zone of #Tigray have seized more than Birr 2.2 million allegedly used for illegal money lending, amid warnings that usury is increasingly exploiting communities affected by persistent cash shortages.
In a press statement issued on 27 January 2026, Deputy Inspector Gebre-Anenya Teklay, representing the Shire Endaselassie city police commander, said an individual was apprehended on 25 January in Kebele 04 after being caught in the act of distributing cash while charging interest rates of between three and five percent. The suspect was taken into custody along with the seized cash, he said.
Deputy Inspector Gebre-Anenya described usury as a criminal offense under the law and a practice condemned by religious and cultural....
https://www.facebook.com/AddisstandardEng/posts/pfbid02A5LPW2jGC4PugMchMnHxqydpS4jq3qgXECZFWnKqUoK3hgrzwgWMFMuHWgQ9tTe4l
News: #Ethiopian Airlines suspends flights to #Tigray airports
Ethiopian Airlines has suspended flights scheduled for today to airports in Tigray, including #Mekelle, #Axum, #Shire, and #Humera, according to information obtained by Addis Standard.
An Addis Standard reporter on the ground in Mekelle confirmed airport staff were informed to take a break for the day. However, Ethiopian Airlines’ ticket office in Mekelle continued providing services, excluding flights scheduled for today.
“The system is working. We are giving services. We sell tickets scheduled from tomorrow onwards. We reschedule flights and provide other services,” one ticket office staff member told Addis Standard. “But none of us know why flights were suspended today.”
Passengers who had booked flights for today received text messages notifying them of the cancellation. One message sent to customers read:
“Your flight ET0102 from ADD on 29 Jan 2026, at 08:10 AM has been cancelled….
Read more: https://addisstandard.com/?p=54824
News: #Ethiopian Airlines resumes flights to #Tigray after five day suspension
Ethiopian Airlines has resumed flights to Ethiopia’s northern Tigray region after a five day suspension, with the first flight departing from Addis Abeba arriving at #Mekelle#Alula Abanega International Airport at 7:50 a.m., an Addis Standard reporter in Mekelle confirmed.
The national carrier suspended flights to Tigray last Thursday, affecting airports in Mekelle, #Axum, #Shire, and #Humera, as tensions escalated in parts of the region. The suspension disrupted both passenger travel and cargo services, further constraining transportation links between Tigray and the rest of the country.
An officer at the Ethiopian Airlines ticket office in Mekelle confirmed to Addis Standard on Monday that flights had resumed. Speaking on condition of anonymity, the official said services were expected to restart early...
https://web.facebook.com/AddisstandardEng/posts/pfbid034oz7ko4wv6Pk4Uv3HhL6JZccVHUMcLUEZ7KLDT9LkHpPfDajkgvRPT5dxsXqoMRVl
News: Flights to #Tigray remain suspended, affecting even Interim Administration president’s scheduled Addis visit
The continued suspension of #Ethiopian Airlines flights to Tigray has disrupted official travel, with Tigray Interim Administration President Tadesse Worede confirming that his planned visit to #Addis_Abeba did not take place due to the flight cancellations.
Asked by Addis Standard whether his visit was hindered by the suspension of flights, President Tadesse responded, “Yes.”
Flights to airports in Tigray, including #Mekelle, #Axum, #Shire, and #Humera, remained suspended on Friday, with Ethiopian Airlines yet to provide an official explanation for the disruption.
An Addis Standard reporter on the ground confirmed airline ticket office, however, remained open...
Meanwhile, road transportation in parts of Southern Tigray has also been disrupted. Transport movement along the #Woldiya–#Kobo–#Alamata corridor remains limited, while displacement
Read more: https://addisstandard.com/?p=54856
News: Federal police charge suspected trafficking kingpin linked to deaths, abuse of migrants
Addis Abeba —#Ethiopian Federal Police said it has referred to prosecutors the case of human trafficking kingpin #Yitbarek_Dawit (Kibrom) and nine accomplices, accused of orchestrating a cross-border network that trafficked more than 3,000 people and was linked to over 100 deaths and the rape of more than 50 women.
In a statement, police said the suspect, described as an internationally wanted fugitive, was arrested in #Shire town in the #Tigray region following a coordinated operation conducted with the Regional Operational Centre in support of the #Khartoum Process. Authorities said the investigation involved extensive intelligence-sharing across multiple countries.
Police said the suspect used multiple identities to evade capture, including names such as #Yitbarek Dawit Alemu, #Paulos Dawit Wolday, and aliases including #Adhanom, #Ahmed, #Munir, and
Read more: https://web.facebook.com/share/p/1Arn3MFntC/