Вторая по частоте 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
#GTC/USDT analysis :
#GTC is currently retracing towards the 200 EMA, creating a potential long opportunity on lower time frames (LTF). The price has bounced back from the support zone and is anticipated to test higher levels.
TF : 2h
Entry : $0.418
Target : $0.469
SL : $0.385
#GTC/USDT analysis :
#GTC is currently in a downtrend, marked by a series of lower lows (LLs) and lower highs (LHs). The price is trading within a resistance zone, encountering significant resistance. Consequently, a continuation of the decline is anticipated from this level, with the price likely to test lower levels in the near future.
TF : 4H
Entry : $0.658
Target : $0.560
SL : $0.722
#GTC/USDT analysis :
#GTC has broken below support levels. The price is expected to continue falling and test lower levels, as the higher time frame (HTF) is bearish. Wait for the price to retest the zone before entering a short position.
TF : 4h
Entry : $0.644
Target : $0.596
SL : $0.678
#GTC/USDT UPDATE:
#GTC is now trading around 1.27$. #GTC has broken out a Inverse Head and shoulder pattern on hourly time frame. So the Possible scenario is According to the pattern, we can see short term bullish momentum in it and we can see the price pump 15-20%. Stay tuned with us for further updates✔️
#GTC
The coin looks very good, there is buying, there is reaction from the zones, waiting for further markup of the asset to cover the upper weekly imbalance
📈Sign up on Bybit to trade with me