Ранее я уже упоминал о другой фишке из ˍˍ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
Hedera's ETF Potential and Price Correction
Hedera ($HBAR) emerges as a strong contender for a spot ETF in the USA, driven by its ecosystem development and high standards in security and transparency. Currently, it faces a correction after testing a resistance level at $0.260, now moving towards a support zone at $0.195. A sideways movement is anticipated in the coming weeks. BTC price aims for $84,000. Read more: Leviathan News
#Hedera#ETF#Crypto#HBAR#Bitcoin#Investing#Markets#Regulations
Coinbase Lists Solana Futures with CFTC
Coinbase Derivatives has filed with the CFTC to list Solana Futures, nano Solana Futures, and Hedera Futures, marking an expansion in their derivatives offerings for popular cryptocurrencies. For details, check the link: Coinbase Futures Filing.
#Coinbase#Solana#Hedera#Futures#CFTC#Investing#Crypto#DeFi#Finance#Trading#Markets#Blockchain#DigitalAssets#YFI#SEC#Regulation#CryptoNews#Innovation#Tech#VC
Notable Updates on Crypto Events and Funding
White House source confirms Cardano's Charles Hoskinson excluded from the March 8 Crypto Summit. Cardano hasn't engaged with the administration in policy talks. Additionally, DoubleZero Foundation raises $28M at $400M valuation, plans expansion. CANARY files S-1 for AXL ETF, focusing on blockchain interoperability.
#Cardano#Crypto#Hoskinson#DoubleZero#Blockchain#Funding#AXLETF#Web3#Investing#Valuation#Solana#XRP#Hedera#Stellar#TON#Sui#Bitcoin#VC#Testnet