Ранее я уже упоминал о другой фишке из ˍˍ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
Les agriculteurs contrôlent un camion bétaillère arrivant d’Allemagne en direction de l’Espagne, avec des génisses à bord.
On ne sait pas si elles ont la dermatose (DNC).
Camion néerlandais, chauffeur irlandais.
À méditer.
Bah voilà la preuve que leurs magouilles sont bien préparées, et la protection sanitaire?
Bah non, les Français n’ont qu'à abattre leurs animaux.
https://youtube.com/shorts/4RHk6JDg7h4?si=G5BWxL5Jg90WMmQR
#CoordinationRurale#AgriculteursEnColère#Mobilisation#DNC#Mercosur
Rejoignez-nous 👇
https://t.me/nemesisiam
This election is not just about what happens within U.S. borders—it’s about the lives of millions around the globe. When you vote, you’re making a statement about where America stands on human rights. History has shown us that you cannot negotiate with leaders who offer nothing but empty promises. Kamala Harris herself said, "Never let anyone tell you who you are. Show them who you are." Well, the Biden-Harris administration has shown us who they are. For ten months, they’ve done nothing but fund the annihilation of Gaza and the West Bank.
We cannot accept these empty words when hundreds of thousands of lives are at risk. It’s time to demand real action, not just lip service. Sign the petition to enact an arms embargo on Israel, spread the truth in your community, and mobilize for the sake of humanity.
Take Action Now:
🖋️ Sign the Petition: Not Another Bomb! Demand an arms embargo to stop the genocide (in our stories)
📰 Stay Informed: Join the Uncommitted Movement and tell Kamala Harris to stand on the right side of history. Sign up for updates.
🗣️ Spread the Word: Distribute flyers, educate your community, and support candidates who truly stand for human rights.
#KillerKamala#BidenHarris#USElections#DNC#ActForGaza#EndTheOccupation#NoMoreEmptyPromises#FreeGaza#FreePalestine#PermanentCeasefire#UNSecurityCouncil#GlobalImpact#FFC#FreedomFlotilla