Ранее я уже упоминал о другой фишке из ˍˍ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
#GRT/USDT analysis :
#GRT has broken out of its trendline with strong momentum following a bounce back from the support zone. The price is expected to maintain its bullish momentum and test previous highs. The current level presents a favorable entry opportunity.
TF : 1W
Entry : $0.2023
Target : $0.3446 and $0.4902
SL : $0.1450
#GRT/USDT analysis :
#GRT is currently in a downtrend, making lower lows (LLs) and lower highs (LHs), and is trading below the 200 EMA. The price is facing rejection from both the 200 EMA and the resistance zone. It is expected to decline from this point and potentially test the previous swing low.
TF : 1D
Entry : $0.1682
Target : $0.1294
SL : $0.1940
💰#GRT has a falling wedge pattern on 8H Time frame, we expec it will pump alot in the case of breakout, waiting now..⌛️
❄️@signals_bitcoin_crypto❄️
❄️@Shadow_support0o❄️
💰#GRT bounced back from the Support zone on 12H Time frame, we are waiting for breakup and pullback to the broken trendline 💫
❄️@signals_bitcoin_crypto❄️
❄️@Shadow_support0o❄️