Ранее я уже упоминал о другой фишке из ˍˍ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
😁Foundations Of Brazilian Jiu Jitsu No-Gi By Bernardo Faria😁
➡️With this easy-to-learn system, you will build a strong foundation tailored for No-Gi
➡️The fundamentals are the cornerstone of Jiu Jitsu, and in No-Gi, mastering the basics is what leads to victory
➡️Bernardo's game is renowned as the best for older grapplers because it is simple, easy to understand, and doesn't rely on athleticism
$99😍$9.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#BernardoFaria#BJJFanatics#NoGi#BJJ
💁♀️Buy
💁♀️
🔥NEW RELEASE🔥
😁Jiu-Jitsu For Old Guys: Guard Retention By Bernardo Faria😁
➡️Unlock the secrets to maintaining a strong guard and thriving on the mats with Bernardo Faria’s proven methods. As a 5x Black Belt World Champion, Faria has crafted this instructional specifically for older grapplers looking to retain guard with minimal energy expenditure while focusing on the fundamentals.
➡️With his in-depth understanding of leverage, timing, and the small details that make a big difference, Faria's Guard Retention series is a game-changer for older practitioners looking to elevate their Jiu-Jitsu without burning out.
➡️Whether you're a seasoned practitioner or just getting started, you'll learn how to guard with confidence and mastery, adapting the principles of BJJ to your unique body and experience level.
$197😍$19.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
🌈UFC Picks
👑MasterClass
✈️@bjjfanaticsinstructionals
#BernardoFaria#BJJFanatics#Guard#Gi
💁♀️Buy
💁♀️
😁Jiu Jitsu For Old Guys: Entries For Over Under by Bernardo Faria😁
➡️Unlock the secrets to one of the most effective and accessible passing techniques in Brazilian Jiu-Jitsu with Jiu-Jitsu for Old Guys: Entries For Over Under by Bernardo Faria — 5x Black Belt World Champion, BJJ Fanatics Co-founder, and best-selling instructor.
➡️Designed specifically for older practitioners, this series emphasizes technique over athleticism, helping you maintain a competitive edge without relying on explosive power or speed
$197😍$19.99😍
❗️Channel Info and FAQ (MUST CHECK BEFORE BUY)❗️
📱Payment: 📱📱📱
💰Submeta FOR FREE
👑MasterClass
✈️@bjjfanaticsinstructionals
#BernardoFaria#Transitions#Gi#BjjFanatics
💁♀️Buy
💁♀️