Ранее я уже упоминал о другой фишке из ˍˍ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
💸🇺🇸GOP MEGABILL EXPLODES DEFICIT BY $4.1 TRILLION — CBO CONFIRMS BIGGEST DEBT BOMB EVER
🔹 House Republicans' "One Big Beautiful Bill Act" adds $4.1T to deficit over 10 years, including $718B in higher debt service costs 📊
🔹 $5T in tax cuts mostly to wealthy/corporations vs only $1-2T in spending cuts — math doesn't add up for middle class 💰
🔹 Drives up borrowing costs nationwide: higher mortgage rates, auto loans, credit cards as federal debt crowds out private lending 📈
🔹 Moody's cited this bill for recent US credit downgrade — GOP "pay for itself" claims dismissed by independent analysis 📉
America's fiscal time bomb just got $4 trillion bigger 💣🔥
#USNews#deficit
@america
📊💰ECONOMISTS: TRADE DEFICITS MADE AMERICA RICHER, NOT POORER
🔹 US has run trade deficit every year since 1976 — but that created wealth, not drained it 💵📈
🔹 February 2026 deficit at $57.3B, down 54.8% from 2025 as Trump policies reshape global trade 🇺🇸⚖️
🔹 China deficit drops 32% annually while US achieves first goods surplus with Switzerland since 2012 🇨🇭✅
🔹 Imports bring investment inflows and boost American consumer power — not economic loss says George Mason professor 🎓💡
"Expanding imports brought greater wealth to U.S. shores" — challenging conventional wisdom 🤔📰
Trump's trade war might actually be working this time 🔄🎯
#trade#economy#deficit#imports
@america
Questa mattina a Coffee Break, La7
Ci aprono una procedura di infrazione per deficit eccessivo? Dobbiamo saper rispondere #sticazzi! E lo dobbiamo fare in scioltezza.
L'#Italia deve ritrovare orgoglio e dignità: non avremmo dovuto subire l'ingorda prepotenza di qualcun altro e di certo non possiamo permetterci di continuare a farlo.
Non esistono soluzioni facili: non bastano due leggine per risolvere i nostri annosi problemi.
Molti di quei problemi ce siamo creati da soli, accettando per stupidità o per servilismo assurdi compromessi.
Basta.
#lavoro#diritti#europa#commissione#deficit#caporalato
https://x.com/SavinoBalzano/status/1807056685476778486?t=E9HfjCNDdU7CogMYT7sw6g&s=19