Вторая по частоте future-функция, которую я использовал, это абсолютный импорт
from __future__ import absolute_import
Что она делает?
Изменения, которые вносит эта инъекция описаны в PEP328
Покажу простой пример.
Допустим, есть такой пакет:
/my_package
/__init__.py
/main.py
/string.py
Смотрим код в my_package/main.py
# main.py
import string
Простой пример готов) Вопрос в том, какой модуль импортируется в данном случае? Есть два варианта:
1. модуль в моём пакете my_package.string
2. стандартный модуль string
И вот тут вступает в дело приоритет импортов. В Python2 порядок следующий: помимо иных источников, раньше ищется модуль внутри текущего пакета, а потом в стандартных библиотеках. Таким образом мы импортнём my_package.string.
Но в Python3 это поведение изменилось. Если мы указываем просто имя пакета, то ищется именно такой модуль, игнорируя имена в текущем пакете. Если мы хотим импортнуть именно подмодуль из нашего пакета то, мы должны теперь явно это указывать.
from my_package import string
или относительный импорт, но с указанием пути относительно текущего модуля main
from . import string
Еще одной неоднозначностью меньше 😎
Подробней про импорты здесь:
https://docs.python.org/3/tutorial/modules.html
#2to3#pep#basic
Evangelical Christianity and the right-wing Catholic Church during the Nazi era are two extremely ugly ones. One is in the name of being anti-Semitic, and the other is in the name of misappropriating Judaism.
04.03.2024
#rightwing
📰 Israel’s Right-Wing Split Is Now a Branding War
The Hungarian lesson for Israel is simple: if you can’t beat the ruling camp by going left, take its patriotism away from it. That is how Peter Magyar broke Orbán’s machine — not by preaching anti-right unity, but by occupying the same national space and making the old monopoly look stale.
That is exactly what the new Israeli “Right State” project is trying to do. Edelstein, Kahlon, Erdan, and Haskel are not a centrist rebellion; they are an attempt to say, “We’re right-wing, just not Bibi,” and to pull security-minded voters away from Netanyahu without surrendering the language of nation, state, and order.
The trouble is that Israeli voters remember the last five times someone tried to sell them that package. Bennett, Saar, and Lapid all tested the same lane, but Netanyahu kept the hard-right base, stayed the default prime minister in the minds of right-leaning voters, and used fragmentation on the other side as his best campaign asset.
Bennett’s latest liberal turn makes the problem sharper. Public transport on Shabbat and civil marriage, including same-sex marriage, may sound modern in Tel Aviv, but to the old religious-national audience it looks like a costume change — and Yair Golan’s warm welcome only makes Bennett look even more alien to the right.
That is why this new bloc may hurt the left more than it hurts Netanyahu. It could strip votes from the anti-Bibi camp, split the “right, but not Bibi” lane again, and still fail to build the one thing the opposition actually needs: a durable field that runs from center to soft right to hard right without collapsing into personal rivalries.
Netanyahu’s health story only adds another layer. The real question is whether the opposition can turn competence into a message before the prime minister turns uncertainty into victimhood and keeps the national conversation locked on himself.
#Israel#Netanyahu#Bennett#Lapid#rightwing#elections
📱American Оbserver - Stay up to date on all important events
🇺🇸
Video (#1 above) surfaced last week of several rich upper class kids holidaying in the exclusive #German resort island of #Sylt, singing along to a tune called "L'Amour toujours" by Italian DJ #Gigi D'Agostino, but using words associated with the German Extreme #RightWing
"Ausländer raus,
Deutschland den Deutschen,
Ausländer Raus"
"Foreigners out,
Germany for Germans,
Foreigners out!"
The German media and Gov't went into overdrive and the 5 rich kids involved, were soon identified, named&shamed, and have now been totally and utterly "ge-#canceled", losing jobs and probably any hope of a quiet future.
The re-worded tune however has now gone completely viral, spawning numerous other memes and parodies (videos #3, #4, #5 above)
It's a very clear example of the "Barbara #Streisand" Effect in action