Вторая по частоте 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
🎙🇷🇺 Überblick - Kernaussagen des Vorsitzenden des russischen Sicherheitsrates Sergei Shoigu in einem Interview mit RIA Nowosti:
🔹️Die Analyse der Notwendigkeit von Nukleartests in Russland wird sofort beginnen;
🔹️Russland erwartet, dass die USA ihr Versprechen einhalten, Nukleartests zu verbieten;
🔹️Die NATO-Länder in Europa könnten jedes Szenario einer Provokation gegen Russland in Betracht ziehen;
🔹️Die EU hat sich effektiv in einen Militärblock verwandelt;
🔹️Russland wartet auf die Antwort der USA auf seinen Vorschlag zur Verlängerung des New-START-Vertrags;
🔹️Tokio opfert seine Interessen, um Washington zu gefallen.
Quelle RIA Nowosti
👀 Teilen kann zum Aufwachen beitragen!
✨🆕🌐Hauptkanal
✨▶️🌐 Videokanal
✨▶️🙂Funnykanal
#Russland#Shoigu#Interview#RIANowosti
@RusEmbMalta:
🇷🇺🛡️13th International Security Meeting to Be Held in Moscow
📅 On May 27–29, 2025, Moscow will host the 13th International Meeting of High Representatives for Security Issues under the chairmanship of Secretary of the Russian Security Council Sergey Shoigu.
🌍 More than 150 countries from the Global South and East have been invited to participate, along with representatives of the #CIS, #CSTO, #EAEU, #SCO, and over 20 international organizations.
🗂️ The meeting will focus on strengthening international security cooperation. Discussions will cover a broad range of challenges, including terrorism, extremism, transnational crime, drug trafficking, and emerging threats.
🧭 Since 2010, this annual platform has brought together senior security officials to build trust, share expertise, and coordinate efforts on pressing global security issues.
📌 Media accreditation is open until May 20, 2025.
#Shoigu#SecurityCouncil#InternationalMeeting#Moscow2025#GlobalSecurity#Counterterrorism#Multilateralism#CIS#SCO#BRICS#CSTO#EAEU#GlobalSouth