TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #76 · 27 апр.

Ранее я делал серию постов про битовые операторы. Вот вам ещё один наглядный пример как это используется в 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

Резултати

Пронајдени 1 слични објави

Пребарај: #voterid

当前筛选 #voterid清除筛选
American Оbserver

@american_observer · Post #5203 · 23.02.2026 г., 02:04

📰 Jim Snow 2.0: NYC Needs More ID to Shovel Than to Vote New York’s socialist mayor Zohran Mamdani is begging people to shovel snow for the city — and demanding more paperwork than the Board of Elections asks for to pick the president. Emergency snow laborers have to be eligible to work in the U.S. and show up with two small photos, two original forms of ID (plus copies), and a Social Security card. To vote in New York City? Most registered voters don’t need to show any ID at the polling place at all. The same crowd that screams “Jim Crow” at voter ID laws is now totally fine with a mini-Patriot Act to push a shovel for $20–28 an hour. Undocumented immigrants — whom Mamdani insists should stay, work, and be protected — are automatically locked out, because the city can’t hire them without papers, and City Hall suddenly cares a lot about federal law when it’s their own HR department on the hook. Right-wing media calls this “Jim Snow 2.0” and “Snowcialism,” but the punchline cuts both ways. Conservatives get to yell “hypocrite” at a socialist mayor who requires a Social Security card for day work while opposing ID at the ballot box. Progressives get to quietly keep a system where corporations and private contractors still use undocumented labor off the books — just not on a city payroll where somebody might actually get audited. So New York ends up with the perfect late‑imperial compromise: - democracy you can enter with a signature and a shrug, - casual labor that requires a mini background check, - and a mayor who talks like ICE should be abolished but runs his snow-removal program like a low-budget TSA. The only people not in on the joke are the ones actually freezing on the sidewalk — and they’re the ones the city just told to bring five pieces of ID if they want to get paid to dig everyone else out. #NYC#Mamdani#voterID#immigration#snow#fakeDemocracy 📱American Оbserver - Stay up to date on all important events 🇺🇸