Ранее я уже упоминал о другой фишке из ˍˍ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
Bliss - Official | Android 15 | Nothing Phone (2)
✍️ Details:
- Version: 18.5
- Codename: #Pong
- Released: 21/4/25
🔽Download:Vanilla | Vanilla(Mirror) (Recovery Build)
🆘 Support : Here
⚙️ Installation: Here
📸 Screenshots: Here
🔖 Tags : #ROM#AOSP#Official#Bliss#V
✨ ChangelogsROM | Device
✍️ Note:
- Vanilla only
- clean flash recommended
- you can use this gapps: here, or flash your choice of gapps/microg if you know what you're doing
- ksu disabled bcs of official requirements
🏆 Credits
- @Ghosuto7 for DT
- Hellboy for Meteoric kernel
- Fabian for PA Glyph Implementation
- Testers
😎 Maintainer : @Drishal
🔔 Updates : @NothingPhone2Updates
💬 Chat : @NothingPhone2
Bliss - Official | Android 15 | Nothing Phone (2)
✍️ Details:
- Version: 18.2
- Codename: #Pong
- Released: 29/1/25
🔽 Download: [ Vanilla | Gapps ] (Recovery Build)
🆘 Support : Here
⚙️ Installation: Here
📸 Screenshots: Here
✨ Source Changelogs: Here
🔖 Tags : #ROM#AOSP#Official#Bliss#V
✨ Changelogs
- Update to NOS V3.0-250113-1723 firmware
- Improvements to system performance and stability
✍️ Note:
- Both Gapps and Vanilla build available
🏆 Credits
- Chandu for base DT
- Hellboy for Meteoric kernel
- Fabian for PA Glyph Implementation
- Testers
- Note: bliss is not patched with ksu due to official requirements
😎 Maintainer : @Drishal
🔔 Updates : @NothingPhone2Updates
💬 Chat : @NothingPhone2