Ранее я уже упоминал о другой фишке из ˍˍfutureˍˍ , это оператор деления.
from __future__ import division
Суть проста. Раньше сложность типа данных результата поределялась типом самого сложного операнда.
Например:
int/int => int
int/float => float
В первом случае оба операнда int, значит и результат будет int. Во втором float более сложный тип, поэтому результат будет float.
Если нам требуется получить дробное значение при делении двух int то приходилось форсированно один из операндов конверировать в float.
12/float(5) => float
Но с новой "философией" это не требуется. В Python3 "floor division" заменили на "true division" а старый способ теперь работает через оператор "//".
>>> 3/2
1.5
>>> 3//2
1
То есть теперь деление int на int даёт float если результат не целое число.
В классах теперь доступны методы __floordiv__() и __truediv__() для определения поведения с этими операторами.
Данный переход описан в PEP238.
#pep#2to3#basic
#TLM/USDT analysis :
#TLM has successfully broken out and retested the previous swing high level. The price is expected to rebound from this point and test the previous highs again.
TF : 1W
Entry : $0.01480
Target : $0.02400/$0.03260
SL : $0.01067
#TLM/USDT analysis :
#TLM is on the upswing, creating higher highs (HHs) and higher lows (HLs) above the 200-period exponential moving average (200 EMA). Currently, the price is undergoing a corrective pullback. It's probable that it will test the support zone and then rebound from there to sustain its bullish momentum and aim to revisit previous highs.
TF : 1h
Entry : $0.01160
Target : $0.01209
SL : $0.01128
#TLM/USDT analysis :
#TLM is presently in an uptrend, forming higher highs (HHs) and higher lows (HLs). The price is currently trading above the support zone and is projected to rebound from there to sustain its bullish momentum and retest previous highs.
TF : 1h
Entry : $0.01093
Target : $0.01144
SL : $0.01056