Ранее я уже упоминал о другой фишке из ˍˍ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
#Altseason is close: altcoin capitalization is preparing a breakout from the descending channel
The guys from #K33#Research are waiting for a new maximum capitalization of the crypto market soon, because 1,051 days have passed since the previous #ATH, and the longest period is 1,106 days.
Meanwhile, #BTC is again trying to break through and gain a foothold above $66k
K33 Predicts Bull Run Peak Date
📈 K33 analysts forecast the peak date of the bull run. ⚖️ Craig Wright receives a conditional sentence for contempt of court. 💵 VC investors are retreating from crypto as the market shifts. 📊 Bitcoin's failure at $100K triggered over $1 billion in liquidations. 🐋 El Salvador expands Bitcoin purchases despite IMF deal. 💬 Tornado Cash co-founder demands dismissal of charges. 👾 Ilya Lichtenstein claims sole responsibility for Bitfinex hack. 💰 Cryptopia clients received $225 million in assets from liquidators. ✅ SEC approves first hybrid ETFs based on Bitcoin and Ethereum. 👁 German regulator orders World to delete user data. 👀 Investors file a lawsuit against the HAWK token team. ⚽️ American football player to receive part of salary in Bitcoin. 🚀 Cathie Wood confirms Bitcoin price prediction above $1 million.
#K33#CraigWright#Crypto#Bitcoin#Liquidations#ElSalvador#TornadoCash#Bitfinex#Cryptopia#SEC#ETFs#Germany#HAWK#Football#CathieWood#Investors#Funding#VentureCapital#Market#Investments
Crypto Highlights: Recent Developments
📈 K33 analysts have predicted the peak date of the bull run.
⚖️ Craig Wright received a conditional sentence for contempt of court.
💵 VC investors are leaving crypto, while crypto distances itself from VC investors.
📊 A Bitcoin crash at $100,000 led to over $1 billion in liquidations.
🐋 El Salvador expanded its Bitcoin purchases despite an IMF deal.
💬 Tornado Cash co-founder demands charges be dropped.
👾 Ilya Lichtenstein claims sole responsibility for the Bitfinex hack.
💰 Cryptopia clients received $225 million in assets from liquidators.
✅ SEC approved the first hybrid ETFs based on Bitcoin and Ethereum.
👁 German regulator ordered World to delete user data.
👀 Investors sued the team behind the HAWK token.
⚽️ An American football player will receive part of his salary in Bitcoin.
🚀 Cathy Wood confirmed her Bitcoin price prediction exceeds $1 million.
🤑 Colin Wu shared the success story of a 24-year-old crypto trader.
#K33#CraigWright#VC#Bitcoin#Liquidation#ElSalvador#TornadoCash#Bitfinex#Cryptopia#SEC#ETFs#Germany#HAWK#Football#CathyWood#CryptoTrader#CryptoNews#Investments#MarketTrends#CryptoRegulation#Blockchain