Вторая по частоте 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
#LTO/USDT analysis :
#LTO is currently rejecting from a double top resistance zone and showing bearish signs. It is expected to continue declining and test the previous swing low.
TF : 1h
Entry : $0.1124
Target : $0.1079
SL : $0.1151
#LTO | Bounced From Support Level 🧱
How did we find this detection?
1⃣ Visit Detection Analysis at CoinLegs
2⃣ S/R Analysis
3⃣ Variables:
Binance<>USDT<>1h<> Above the S/R Zone<>Weaker
4⃣ Start Analysis
That's it.
Trade easily with free advanced trading tools 💹
#LTO bounced from the Weekly Demand zone,also broken up the trendline and now we are waiting for a pullback to enter the train 🚀
❄️@signals_bitcoin_crypto❄️
❄️@Shadow_support0o❄️
#LTO result
2nd target achieved in just 5 hours ✅✅
One more quick profit 9%💰🤑
👉 The longer you wait more you lose profit. Hurry up 🏃♂
☎️ Contact @MichaelStrategiesVip
🛒Coin added - LTO Network#LTO paired with #USDT on Binance looks good for a long-term investment.
It ranks 345 in the CoinMarketCap rating.
Good fundamentals stuff are expected by the end of the year.
The coin has not pumped and is in a neat uptrend.
The price is at the exit from the resistance zone.
Price projector indicates a rise of $0.15.
Support is the $0.05-0.06 zone.
Growth in my experimental portfolio is expected from 70 to 190%.