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

Резултати

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

Пребарај: #maritimeblockade

当前筛选 #maritimeblockade清除筛选
Crypto M - Crypto News

@CryptoM · Post #65224 · 12.04.2026 г., 04:24

🚀 U.S. President Trump Considers Maritime Blockade Against Iran On April 12, U.S. President Donald Trump posted on Truth Social about a potential maritime blockade against Iran. According to BlockBeats, Trump suggested this measure if Iran does not make concessions. The statement highlights ongoing tensions between the United States and Iran, with the possibility of escalating actions if diplomatic solutions are not reached. #Trump#Iran#MaritimeBlockade#USIranTensions#Diplomacy#TruthSocial#TrumpStatement#IranConcessions

Crypto M - Crypto News

@CryptoM · Post #65389 · 13.04.2026 г., 04:28

🚀 U.S. Maritime Blockade Could Impact Iran's Oil Exports, Says Garrett Jin Garrett Jin has indicated that a U.S. maritime blockade around the Strait of Hormuz could potentially reduce Iran's oil export income by approximately 1.7 million barrels per day. According to NS3.AI, Jin noted that the blockade primarily targets Iranian ports rather than completely closing the strait, allowing for the possibility of third-party transshipment. However, he cautioned that this measure might not be sufficient to resolve the ongoing conflict. #US#MaritimeBlockade#Iran#OilExports#StraitOfHormuz#GarrettJin#EconomicImpact#NS3AI#Conflict

Crypto M - Crypto News

@CryptoM · Post #65394 · 13.04.2026 г., 04:52

🚀 Strait of Hormuz Traffic Halts Following U.S. Maritime Blockade All maritime traffic through the Strait of Hormuz has reportedly ceased after U.S. President Donald Trump declared a maritime blockade via social media. According to NS3.AI, information from British sources, as reported by CCTV News, indicated that the blockade had been in place for several hours. While traffic was still feasible on the 12th, at least two vessels attempting to exit the strait reversed course. Tanker traffic had seen a slight uptick on the 11th before declining on the 12th. #StraitOfHormuz#MaritimeBlockade#USPresident#DonaldTrump#TankerTraffic#CCTVNews#NS3AI#MaritimeTraffic