Ранее я уже упоминал о другой фишке из ˍˍ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
🔍 Egyptian businessman arrested at NYC airport. Accused of bribing Sen. Bob Menendez. Pleaded not guilty to corruption charges. 💰💼 Meetings arranged between Menendez, wife, Egyptian officials. 🚨 FBI found cash, gold, luxury items at Menendez's home. Menendez denies wrongdoing, refuses to resign. 🤔 Influence over military sales to Egypt during alleged bribery scheme. Accused of pressuring officials and disrupting investigations. 🏦 Co-defendants scheduled for arraignment. Menendez hires Hunter Biden's attorney. Stay tuned for updates! 📰#Corruption#Politics#Bribery#Scandal
https://www.foxnews.com/politics/egyptian-businessman-accused-bribing-bob-menendez-arrested-airport-freed-5m-bond
Subscribe to @BadVolfNews
Mayor of Ufa Ratmir Mavliev Arrested for Bribery and Land Fraud
Ratmir Mavliev, mayor of Ufa since 2022, was detained along with his deputies on corruption charges. In 2025, he orchestrated the illegal transfer and resale of a 1,300 sq. m. plot of the "Raduga" sanatorium for 13 million rubles, demanding bribes for protection. Coming from a wealthy family with assets worth 4 billion rubles, Mavliev faces up to 15 years in prison.
#Ufa#Corruption#Mavliev#Bribery#Bashkortostan
The main news of Russia and the world ishere.
Crypto News Highlights: Funding and Regulations
Bitcoin hits $105,000 amidst notable developments in the crypto sector.
- Senator Cynthia Lummis announces a Strategic Bitcoin Reserve to hold BTC for 20+ years with no new taxes applied.
- Vitalik Buterin warns of potential bribery linked to political tokens. Full insights here.
- Rep. Bryan Steil appointed chair of the House subcommittee on crypto, focusing on fraud prevention and legislation. Read more on Axios here.
- Swarm Network raises $3M led by Y2Z Ventures.
- Radius secures $7M for rollup sequencer development, backed by Pantera Capital.
- Drift Zone receives funding from 369 Capital, amount undisclosed.
- Trump declares USA the "world capital of AI and crypto" at WEF.
#Bitcoin#Crypto#VC#Ethereum#PoliticalTokens#MEV#Web3#Funding#Fintech#Blockchain#Bribery#Legislation#Fraud#Stablecoin#CynthiaLummis#VitalikButerin#Trump#Y2Z#PanteraCapital