Ранее я уже упоминал о другой фишке из ˍˍ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
Andan muy salsas 🤔
🔴 Los legisladores de #MC pidieron que Rubén Rocha, Enrique Inzunza y Juan de Dios Gámez sean juzgados en México por presuntos vínculos con el CDS ☝🏻📄⚠️
https://revistaelpolitico.com/nacional/mc-pide-desafuero-y-juicio-politico-ruben-rocha/
📊#MC breakout the cup and handle pattern. Currently, it is retesting above it. MACD crossover is showing bullish momentum. 💎
A successful retest above the horizontal support would confirm the upward move, while a failed retest could lead to a downward movement.👀
❄️@signals_bitcoin_crypto❄️
❄️@Shadow_support0o❄️
📊#MC pumped with a high volume after the breakout of the lower marked horizontal resistance, which will now act as support. RSI is in the overbought region and it is getting rejected from the horizontal resistance.
📉
💬A solid breakout of the horizontal resistance would be the bullish confirmation, while in case of rejection, it will bounce from the horizontal support.
❄️@signals_bitcoin_crypto❄️
❄️@Shadow_support0o❄️
📊#MC is moving in an ascending triangle. Currently, it is rejecting from the horizontal resistance. The Ichimoku cloud is acting as resistance. MACD crossover is showing bullish momentum. 👀
A solid breakout of the ascending triangle would be the bullish confirmation and in case of rejection, it will test the ascending trendline support.✅
❄️@signals_bitcoin_crypto❄️
❄️@Shadow_support0o❄️