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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #60 · 31 мар.

Вторая по частоте 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

Резултати

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

Пребарај: #keyevents

当前筛选 #keyevents清除筛选

🎙Russia's Permanent Representative to the UN Vassily Nebenzia’s answers to media questions on the occasion of assuming UNSC Presidency by Russia (October 1, 2025) Major talking points: #KeyEvents • The Council will travel to Addis Ababa in October. Russia is honored to be leading the UNSC together with our co-leads in Somalia. A new department – on Partnerships with Africa – has been recently established in the Russian Foreign Ministry. Therefore, the visit to Addis will be the highlight of our Presidency. • October 23 – open debate on the Middle East: The unfolding catastrophe in Gaza will be in the focus of the Council’s attention. We expect Deputy Special Coordinator Ramiz Alakbarov to brief the Council. • October 24 – the UN Day (80th Anniversary of the UN Charter): an open debate titled UN: Looking into the Future. Aim: strict implementation of the principles of the UN Charter, restoring confidence in the Organization and long-term vision for its future. We expect the Secretary-General to brief the Council. • October 6 – Women, Peace and Security: it is the 25th anniversary of the UNSC seminal Resolution 1325. This event hold special importance to us, as the Soviet Union pioneered the women’s agenda more than a hundred years ago promoting equal rights. #JCPOA • Our Western colleagues who initiated the so-called “snapback”, the legitimacy of which we do not recognize, forfeited a diplomatic solution by initiating an illegal procedure while being serial violators of Resolution 2231. Russia and China offered to extend Resolution 2231 to give diplomacy a chance, which they basically killed. We do not recognize this “snapback” as coming into force. We are not, frankly, happy that the Secretary-General rushed to implement the resolution, which has obvious legal flaws. • We are looking forward to direct or indirect negotiations with the US that can bring results. Such dialogue is not happening now, and this situation is fraught with major escalation around Iran, opening the door to attempts to end its nuclear program – yet another destabilizing factor in an already fragile Middle East. #RussiaUN • We emphasize that the UN is indispensable, that its Charter must be applied in its entirety, and that attempts to bypass or weaken the Organization with "exclusive clubs" undermine global peace and security. Russia advocates a more representative, multipolar UN that reflects the voices of the Global South. • The UN is a reflection of the geopolitical situation that is in the world. Should we blame the Organization for it? For me, the UN is a sum of its Member States. If they cannot agree on anything, it is unfair to blame the UN for it. Margaret Thatcher said once that if you want to blame the UN, go and look in the mirror. Read in full