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

Резултати

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

Пребарај: #usirantensions

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

@CryptoM · Post #65411 · 13.04.2026 г., 05:59

🚀 Oil Prices Surge Above $105 Amid U.S.-Iran Tensions Oil prices have climbed above $105 following the breakdown of U.S.-Iran discussions in Islamabad, which has reignited concerns of potential conflict in global energy markets. According to NS3.AI, the Kobeissi Letter reported that Google search interest for 'price of oil' has reached an unprecedented level, surpassing the peaks of 2022 and 2008 by 300%. #OilPrices#USIranTensions#EnergyMarkets#GlobalEconomy#CrudeOil#MarketVolatility#OilCrisis

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 #65180 · 11.04.2026 г., 16:54

🚀 Bitcoin Market Divides Amid Ongoing U.S.-Iran Tensions The Bitcoin market is experiencing a notable division amid the ongoing U.S.-Iran geopolitical tensions, which have persisted for approximately six weeks. According to ChainCatcher, the market is split between passive buyers, such as those involved with Strategy and spot ETFs, who continue to accumulate, and entities like whales, mining companies, and some sovereign holders, who are reducing their holdings. On the selling side, there is a clear trend: whale addresses holding between 1,000 and 10,000 BTC have shifted from net buying to significant net selling, with their holdings changing from an increase of about 200,000 BTC to a decrease of 188,000 BTC this year. Publicly listed mining companies, under pressure from high costs, have also been selling off, with weekly sales exceeding 19,000 BTC. Additionally, sovereign holders like Bhutan have reduced their Bitcoin reserves by approximately 70% since October 2024. Analysts note that despite market sentiment reaching extreme fear levels, Bitcoin's price has remained within the $65,000 to $73,000 range. This stability suggests that the price floor is primarily supported by a few institutional buyers. The current market's buying base is narrowing, and future trends will depend on whether institutional capital inflows can continue and break through key resistance levels. #Bitcoin#Cryptocurrency#BitcoinMarket#USIranTensions#CryptoTrading#BitcoinWhales#InstitutionalInvestors#BitcoinETFs#CryptoAnalysis#MarketTrends#BTC