Вторая по частоте 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
#SXP/USDT analysis :
#SXP has broken out of the trendline, and the price has also rebounded from the support zone following a period of sideways consolidation. It is anticipated that the price will continue to rise from the current level and test previous swing highs.
TF : 1D
Entry : $0.3240
Target : $0.5629
SL : $0.2055
#SXP/USDT analysis :
#SXP has bounced back from the 200 EMA after a retracement and a breakout of the trendline. It is now expected to move towards the previous swing high level.
TF : 2H
Entry : $0.2592
Target : $0.2894
SL : $0.2495
#SXP/USDT analysis :
#SXP is presently in an uptrend, forming higher highs (HHs) and higher lows (HLs). It is expected to experience a pullback near its support zone and is likely to bounce back from there to test higher levels.
TF : 1h
Entry : $0.2416
Target : $0.2538
SL : $0.2339
✅✅ 150% Profit on #SXP/USDT for our Premium Members on Binance Futures/Bybit Futures/OKX Futures& KuCoin Futures
👁🗨Contact @primemod to enter the premium group & make daily profit
#SXP bounced from the support zone on Weekly time frame,now price is trying to break up the falling wedge pattern, breakout incoming..
📈
❄️@signal_bitcoins❄️
❄️@Shadow_support0o❄️