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 слични објави

Пребарај: #axisjapan

当前筛选 #axisjapan清除筛选

🎙 Briefing by Russia's Foreign Ministry Spokeswoman Maria Zakharova (Moscow, November 14, 2025) 🔹#KievRegimeCrimes 🔹Ukraine crisis 🔹Moldovan government’s decision to denounce seven CIS agreements 🔹Developments in El Fasher, Sudan 🔹The US counter-narcotics policy in Latin America 🔹Anti-Russian conference in Dublin 🔹G7 Foreign Ministers’ Meeting in Canada 📰Read 📺Watch #KievRegimeCrimes The neo-Nazi regime in Kiev continues to terrorise civilians in Russia. Over the past week, 53 Russian citizens suffered from artillery shelling and drone strikes, with 8 people killed and 45 injured, including six children. Russian courts continue to hand down sentences to Ukrainian neo-Nazis and mercenaries. In absentia, mercenaries from Georgia, Colombia, and the Czech Republic who participated in combat on the side of the Ukrainian Armed Forces have been sentenced to 28, 13.5, and 13 years in prison. #Ireland#EU#Militarisation Militaristic rhetoric of the [Brussels bureaucracy] finds fertile ground in Dublin, where the ruling coalition <…> is pursuing a course to revise constitutional restrictions on the participation of Irish service members in overseas missions. The Irish run the risk of becoming pawns in reckless geopolitical games of the Westerners (Anglo-Saxons), who are clearly acting against Russia, with all the negative consequences for [Ireland] that this entails. #US#LatinAmerica Since September 2025, we have been witnessing an unprecedented military campaign launched by Washington in Latin America under the pretext of allegedly combating drug-trafficking routes into the United States. We are extremely concerned by the military methods chosen by the United States to address this issue, which amount to little more than blatant interference in the internal affairs of Latin American states. We firmly oppose the use of force or the threat of force to interfere in internal affairs under various pretexts, including counter-narcotics operations. #AxisJapan#WarCrimes#NoStatuteOfLimitations We continue our work on disclosing information about the crimes of Japanese militarism. We have repeatedly emphasised that these crimes have no statute of limitations. Procedural actions aimed at bringing all those responsible to justice continue to this day. Between March and June, the Prosecutor General’s Office of the Russian Federation adopted decisions annulling the conclusions issued in the 1980s–2000s that had granted rehabilitation to 24 Japanese citizens. Following the review of court rulings in cassation and supervisory instances, it was established that these individuals are not subject to rehabilitation. Their guilt has been fully proven. #US#Tariffs From an economic standpoint, the introduction of 500% tariffs on goods from third countries that purchase Russian oil and gas seems absurd. This is tantamount to the discontinuation of all trade relations between countries, as such a tariff rate is prohibitive. Russian energy resources are supplied to dozens of states around the world, including Europe, the Asia-Pacific region, China, and India. It is downright impossible to substitute such volumes of oil and natural gas on the global market within reasonable timeframes. Those who call for [such measures] are likely unaware of the negative consequences this would have both for the United States itself and for the global economy as a whole. Moreover, such a step would be a gross violation of international trade law.