TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #156 · 2 окт.

Те, кто в Python не первый день, хорошо знают, что на число можно умножить не только число, но и другие типы. Главное, чтобы у этих типов была реализация такой операции. # list >>> [1] * 3 [1, 1, 1] # tuple >>> (2, 3) * 3 (2, 3, 2, 3, 2, 3) # string >>> "A" * 3 "AAA" Так работает полиморфизм стандартных типов. Интересно здесь то, что это сработает и в том случае, когда порядок операндов обратный. То есть int умножить на [тип]. # list >>> 3 * [1] [1, 1, 1] # tuple >>> 3 * (2, 3) (2, 3, 2, 3, 2, 3) # string >>> 3 * "A" "AAA" Если хотите реализовать такое поведение в ваших классах то следует помнить два момента: 1. Если множитель справа, то вам нужно реализовать метод __mul__, наш класс это первый операнд, то есть слева. myType * 3 2. Если множитель слева, то вам нужно реализовать метод __rmul__, наш класс это второй операнд, справа. 3* myType Всё тоже самое можно делать и для других математических операторов. И если в этом примере действие и результат будут фактически одинаковыми, то бывают ситуации, когда это не так. Например, при умножении матриц имеет значение порядок операндов. Для других операторов, таких как деление или сдвиг, очень важно кто с какой стороны находится. >>> 2/4, 4/2 (0.5, 2.0) >>> 2<<3, 3<<2 (16, 12) >>> 100%15, 15%100 (10, 15) #tricks#basic

Резултати

Пронајдени 9 слични објави

Пребарај: #bliss

当前筛选 #bliss清除筛选
Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #596 · 21.04.2025 г., 11:13

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

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #567 · 25.02.2025 г., 13:35

Bliss - Official | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 18.3 - Codename: #Pong - Released: 25/2/25 🔽Download:Vanilla | Gapps (Recovery Build) 🆘 Support : Here ⚙️ Installation: Here 📸 Screenshots: Here ✨ Source Changelogs: Here 🔖 Tags : #ROM#AOSP#Official#Bliss#V ✨ Changelogs Rebase tree so clean flash is necessary ✍️ Note: - Both Gapps and Vanilla build available - ksu disabled bcs of official requirements, for kernel with ksu flash this 🏆 Credits - @Ghosuto7 for DT - Hellboy forMeteoric kernel - Fabian & Hellboy for PA Glyph Implementation - Testers 😎 Maintainer : @Drishal 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #539 · 29.01.2025 г., 17:05

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

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #494 · 21.12.2024 г., 10:21

Bliss - Official | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 18.1 - Codename: #Pong - Released: 19/12/24 🔽 Download: [ Vanilla | Gapps ] (Recovery Build) 🆘 Support : Here ⚙️ Installation: Here 📸 Screenshots: Here ✨ Source Changelogs: Here 🔖 Tags : #ROM#AOSP#Official#Bliss#V ✨ Changelogs - Switch to armv9-a and kryo300 CPU variants - 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 😎 Maintainer : @Drishal 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #476 · 24.11.2024 г., 07:09

Bliss - Official | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 18.0 - Codename: #Pong - Released: 24/11/24 🔽 Download: [ Vanilla | Gapps ] (Recovery Build) 🆘 Support : Here ⚙️ Installation: Here 📸 Screenshots: Here ✨ Source Changelogs: Here 🔖 Tags : #ROM#AOSP#Official#Bliss#V ✨ Changelogs - initial A15 official build - Pre rooted allowed in official builds, flash the ksu version youself ✍️ Note: - Both Gapps and Vanilla build available 🏆 Credits - Chandu for base DT - Hellboy for Meteoric kernel - Fabian & Hellboy for PA Glyph Implementation - Testers 😎 Maintainer : @Drishal 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #406 · 23.08.2024 г., 07:20

Bliss - Unofficial | Android 14 | Nothing Phone (2) ✍️ Details: - Version: 17.7 - Codename: #Pong - Released: 23/08/24 🔽 Download: [ GDrive ] (Sideload Build) 🆘 Support : Here ⚙️ Installation: Here 📸 Screenshots: Here ✨ Source Changelogs: Here 🔖 Tags : #ROM#AOSP#Bliss#QPR3#U ✨ Changelogs - initial build ✍️ Note: - Meteoric kernel is baked in with prepatched KSU - gapps already included 🏆 Credits - Chandu for base DT - Hellboy for Meteoric kernel - Fabian for PA Glyph Implementation - Testers 😎 Maintainer : @Drishal 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #471 · 11.11.2024 г., 06:47

Bliss - Unofficial | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 18.0 - Codename: #Pong - Released: 11/11/24 🔽 Download: [ Link ] (Recovery Build) 🆘 Support : Here ⚙️ Installation: Here 📸 Screenshots: Here ✨ Source Changelogs: Here 🔖 Tags : #ROM#AOSP#Community#Bliss#V ✨ Changelogs - initial A15 build ✍️ Note: - Meteoric kernel is baked in with prepatched KSU - Both Gapps and Vanilla build available 🏆 Credits - Chandu for base DT - Hellboy forMeteoric kernel - Fabian and Hellboy for PA Glyph Implementation 😎 Maintainer : @Drishal 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #442 · 24.09.2024 г., 07:54

Bliss - Unofficial | Android 14 | Nothing Phone (2) ✍️ Details: - Version: 17.8 - Codename: #Pong - Released: 24/09/24 🔽 Download: [ Link ] (Recovery Build - flash with ofox) 🆘 Support : Here ⚙️ Installation: Here 📸 Screenshots: Here ✨ Source Changelogs: Here 🔖 Tags : #ROM#AOSP#Official#Bliss#QPR3#U ✨ Changelogs - Add device extras - switch to user build - Add Charging Control - Add dolby support - Improvements to performance and system stability ✍️ Note: - Meteoric kernel is baked in with prepatched KSU - Both Gapps and Vanilla build available 🏆 Credits - Chandu for base DT - Hellboy for Meteoric kernel - Fabian for PA Glyph Implementation - Testers 😎 Maintainer : @Drishal 🔔 Updates : @NothingPhone2Updates 💬 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #626 · 05.06.2025 г., 14:26

Bliss - Official | Android 15 | Nothing Phone (2) ✍️ Details: - Version: 18.6 - Codename: #Pong - Released: 02/06/2025 - Type: #Vanilla 🔽Download:Here | Mirror | Gapps 🆘 Support : Here ⚙️ Installation: Here 📸 Screenshots: Here 🔖 Tags : #ROM#AOSP#Official#Bliss#V ✨ ChangelogsROM | Device ✍️ Note: - Clean flash recommended - 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