Вторая по частоте 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
#HOT/USDT analysis :
#HOT has broken and retested the support levels, which are now acting as resistance for the price. The price is currently in a downtrend on the higher timeframe and is expected to continue its momentum from the current level.
TF : 1H
Entry : $0.00135
Target : $0.00123
SL : $0.00142
#HOT/USDT analysis -
#HOT is currently consolidating sideways above a support line. The price has tapped into liquidity from previous lows below the support line. It appears poised to move upwards, with the previous high as the target level.
TF : 5min
Entry : $0.00145
Target : $0.00150
SL : $0.00143
#HOT/USDT analysis -
#HOT is currently on a downtrend, trading below the 200 EMA. At the moment, it's experiencing a pullback and has retraced to previous support levels near the 200 EMA. The price is encountering resistance near the 200 EMA and appears poised to start moving downwards. It's likely that the price will test previous lows in the near future.
TF : 1h
Entry : $0.00184
Target : $0.00162
SL : $0.00201
4834 new target 5000 🔥
🔥Claim/198 activationsFiredrop 0.25 HOT
How to claim:
╔•1.Join our village.
╠•
╚•2.Subscribe claim 0.25 HOT
🎁Gifts, NFTs, stars, premium Telegram, crypto airdrops, and tokens like 🔥HOT and more! Premium 👥VIP status! Join and win every day!
#hot
#HOT rejected from the ceiling of supply zone on 3D Time frame,it can bounce again from the Green zone, everything is bullish now
📈
❄️@signals_bitcoin_crypto❄️
❄️@Shadow_support0o❄️
🪙1853 new target 2000 #HOT🔥
How to claim:
1) Join our village.
2) Follow @ChatCryptoTON
🔥Claim 170/288 activationsFiredrop0.15 HOT
🔥Claim/88 activationsFiredrop0.25 HOT