Многие из тех кто активно работал с Python2 несколько удивлены, почему в Python3 удобная функция reload() переехала из builtin в imp а потом и в importlib?
Ну было же удобно! А теперь лишний импорт😖
Дело в том, что начиная с Python3.3 функция reload() переписана на Python вместо Cи.
Что это нам даёт?
🔸 Такой код проще поддерживать и развивать
🔸 Python код легче читать, изучать и понимать.
Сравните это ➡️ и это ➡️.
🔸 Как результат пункта 2, проще писать свои расширения импорта. Например, пользовательский импортёр с какой-либо хитрой логикой по аналогии с импортом из zip архивов.
А есть ли у этого решения недостатки? Да, они всегда есть.
🔹 Так как это не builtin функция, её следует импортнуть перед использованием
🔹 Скорость замедлилась примерно на 5%. Очевидно, что это совершенно не критично. К тому же от версии к версии логика импорта будет оптимизироваться и ускоряться.
В самом начале файла importlib/__init__.py мы видим такой импорт:
import _imp # Just the builtin component, NOT the full Python module
То есть часть функционала по прежнему написана на Си, но достаточно низкоуровневая.
#basic
🌎 The black robin of New Zealand bounced back from just five birds left in the world in 1980—thanks to devoted conservation, their population is now stable. This comeback highlights how careful human intervention can save even the rarest species from extinction. ✨
#conservation⚡#wildlife⚡#recovery
👉subscribe Interesting Planet
OrangeFox Recovery Project - Official | Nothing Phone (2)
📝 Details:
- Version: R11.1_1
- Codename: #Pong
- Released: 08/02/24
⬇️ Download : Here
🏛 Support Threads : TG | XDA
⚙️Installation | Visual Tutorial
📸Screenshots
💰 Donate : UPI || PayPal
🏷 Tags: #OFOX#Recovery#Official
🗒 Notes:
Cmds to flash via fastboot:
fastboot flash recovery_a <recovery.img>
fastboot flash recovery_b <recovery.img>
Flashing to both slots is optional! Users can update by flashing the new build over the previous one by flashing the zip in magisk or manually extracting the recovery.img and flashing it via fastboot or supported flashing apps.
If you flash the OTA.zip (Nothing OS update packages), it's recommended to follow these steps for a smooth update process:
1. Flash the OTA.zip.
2. Immediately flash the OrangeFox.zip.
3. Reboot to recovery.
4. Flash the OTA.zip again.
5. Follow up with flashing the OrangeFox.zip.
✨Changelogs:
- Synced with latest sources
- fixes various bugs and problems
- Fixed flags
- Fixed flashing error via old orangefox via last build
- Improved compatibility with custom roms
🏆Credits:
- Nebrassy for his TWRP trees
👤 Maintainer : @phobosc_io
🔔 Updates : @NothingPhone2Updates
🐙 Chat : @NothingPhone2
OrangeFox Recovery Project - Official | Nothing Phone (2)
✍️ Details:
- Version: R11.1_6
- Codename: #Pong
- Released: 17/10/2024
🔽 Download : Here | Toolbox
⚙️ Installation: Here
🆘 Support Threads : TG | XDA
📸 Screenshot: Here
🎄 DT: Here
💵 Donate : UPI | PayPal
🔖 Tags: #OFOX#Recovery#Official#NothingPhone2
💫 Changelogs:
- Update to R11.1_6 version
- Updated prebuilt magisk to v28.0
- Now when flashing image you see all options at once
- Built with latest source
🏆Credits:
- Nebrassy for his TWRP trees
👤 Maintainer : @phobosc_io
🔔 Updates : @NothingPhone2Updates
🐙 Chat : @NothingPhone2