Ранее я уже упоминал о другой фишке из ˍˍ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
Some see a structure. We see a symbol.
Some see concrete. We see the collective will of 150 million people.
Some see a river diverted. We see a destiny harnessed.
The Grand Ethiopian Renaissance Dam is not just about generating megawatts; it's about generating hope. It's about empowering a nation to write its own story of prosperity. It's about telling the world that our future is in our own hands, powered by our own resources.
This is the pride of Ethiopia. A new era of light, energy, and sovereignty.
#ItsMyDam#EthiopiaRising#GERD#NationalPride#Development#Africa
http://t.me/etbisahusen
🎙️WEEK 17 | LIVE DISCUSSION
⚔🛡My Generation & Adwa
Reflecting on the 130th Anniversary of the Victory of Adwa
In honor of the 130th Anniversary of the Victory of Adwa, celebrated on Yekatit 23, 2018 (E.C.), we invite you to a powerful and timely conversation on legacy, identity, and national consciousness.
Tonight, on the Ethiopia First Telegram Channel, we will discuss, reflect, and critically engage on what Adwa means for our generation — and why it still matters today.
Be part of this historic dialogue.
📅February 27, 2026
🕗8:00–10:00 PM (EST) | 2:00–4:00 PM (Ethiopia Time)
🎙️Host: Ethiopia First
🗣️Guest: Alexander Yohannes — Red Nile Media
🔗Join Live:https://t.me/+AAE_Pc8aWTczYTA0
—
#Adwa130#VictoryOfAdwa#AdwaAnniversary#MyGenerationAndAdwa
#EthiopiaFirst#RedNileMedia#EthiopianHistory#AfricanVictory
#PanAfricanLegacy#Yekatit23#EthiopianPride#AdwaSpirit#EthiopiaRising