Вторая по частоте 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
#MKR/USDT analysis :
#MKR is currently in a downtrend. It is advisable to wait for the price to retrace and test the resistance zone for a short entry. The price is expected to resume its bearish momentum and test lower levels.
TF : 4H
Entry : $1,074
Target : $778
SL : $1,209
#MKR/USDT analysis :
#MKR is in a downtrend, forming lower lows (LLs) and lower highs (LHs). The price is anticipated to continue its bearish momentum and test lower levels. It is recommended to wait for a pullback for a short entry.
TF : 2h
Entry : $1,283
Target : $1,006
SL : $1,426
#MKR/USDT analysis :
#MKR is currently consolidating in a channel. The higher timeframe direction shows bearish sentiment, hinting at a possible breakout from the channel to keep moving downwards to lower levels. Waiting for a channel break and the $1,884 level before considering a short entry is recommended.
TF : 2H
Entry : $1,884
Target : $1,576
SL : $2,045
#MKR | Failure Swing detected by CoinLegs Algorithm 😎
A quick and risky position can be opened from the neck area.
Personally, I would be a bit more cautious and wait for the price to come down and rise from there.
Dyor, NFA.
www.coinlegs.com
💰#MKR pullback done,now we are waiting for a bullish momentum from the Green zone,pump it to the moon 🚀
❄️@signals_bitcoin_crypto❄️
❄️@Shadow_support0o❄️