Многие из тех кто активно работал с 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
Tech quiz master
#phone
ℹ️ Ham IT ni ham ingliz tilini o'rganaman deganlar uchun mobil dastur (android). Ancha vaqtlar bu dastur pullik edi, bugun bepul turibdi!
✅ Ushbu dasturda turli darajalarda IT va kompyuter sohasiga oid testlarni ishlaysiz. Faktlar bo'limida esa faktlarni ko'rishingiz mumkin.
⬇️Play Marketdan yuklash
💻 Kompyuterni birga o'rganamiz ⤵️
🛫Telegram I 📺YouTube
Red
Redirect outgoing calls to Signal/Telegram/Threema.
Tiny app to redirect outgoing calls to Signal/Telegram/Threema if available.
You can cancel redirection by clicking on "Redirecting to.." popup.
Download - https://github.com/x13a/Red/releases
https://github.com/x13a/Red
#new#phone
@foss_Android
UNIWA X28 Old Man Flip #Mobile#Phone GSM Senior Big Push-Button Flip Phone Dual Sim FM Radio
Price 24€
Place your order
https://s.click.aliexpress.com/e/_EwCPskl
#bootloader unlock wall of shame
https://github.com/melontini/bootloader-unlock-wall-of-shame
updated guide, check it before buying a #phone
Over the past few years, a suspicious number of companies have started to "take care of your data", aka block/strictly limit your ability to unlock the bootloader on your own devices.
While this may not affect you directly, it sets a bad precedent. You never know what will get the axe next: Shizuku? ADB? Sideloading? I thought it might be a good idea to keep track of bad companies and workarounds.
#android
🪫🔋RealMe presented the world's fastest charger. Charge up to 26% in 1 minute. Full charge up to 100% in 4 minutes and 30 seconds.
#Realme#Charger#Phone
MARKHEMIST
#phone#art
#wallpaper#wallpapers
Wallpaper
https://t.me/Wallpaper
HD-4K-8K-3D
https://t.me/wallpapers
wallpapers
https://t.me/EZwalls
Mobile phone
https://t.me/Wallpapers_Phone_HD_4k_3D_Mobile
smart paper art
https://t.me/swadt
Residents report #phone, #internet#outages in #North_Shewa Zone, leaving families struggling to stay connected
Residents in several districts of North Shewa Zone of the #Oromia region say recent disruptions to mobile phone and internet services have left families unable to communicate, heightening concerns among civilians and students struggling to reach relatives in affected areas.
Residents who spoke to Addis Standard said the communication disruption began weeks ago and has made it difficult to obtain information about the safety and well-being of family members.
This is not the first time communication blackouts have affected the North Shewa Zone. In 2024, residents also reported data outages and network disruptions across parts of the zone in the Oromia region, with some saying the communication blackout persisted for nearly two months amid ongoing insurgency-related security concerns.
https://addisstandard.com/?p=55093