Многие из тех кто активно работал с 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
🔋 "Low-voltage Transmission + DePIN" aims to optimize and enhance the performance and security of low-voltage systems by incorporating decentralized infrastructure.
🔌 Low-voltage transmission, which uses low voltage and small currents to transmit signals and data, combined with DePIN's decentralized features, enables safer, more reliable, and efficient data transmission.
#CyberCharge will integrate hardware chargers using the Charge-to-Earn (C2E) model, allowing users to verify their identity while charging their devices, making data transmission more flexible and decentralized.
#Lowvoltage#DePIN
Like👍, Retweet🔵, Comment
Link to the Tweet!
⚡️#CyberCharge: Innovations in Low-Voltage Transmission
🔌 Our charger not only meets everyday charging needs but also integrates seamlessly with custom modular components for storage and computing.
These modular components are encrypted with our proprietary Cyber C1 AI chip, enhancing system security and reliability.
#LowVoltage#AI#Charger
Like👍, Retweet🔵, Comment
Link to the Tweet!
Elektr ta'minotining past bosimida ham texnikangizning uzluksiz ishlashini ta'minlaydi.
__________________
Обеспечит бесперебойную работу вашей техники даже в условиях пониженной подачи электроэнергии.
#Ishonchli#Barakali#Artel#Yangilik#Новинка#LowVoltage
🧐Did you know? "Low-voltage transmission" uses minimal voltage and small currents to safely transmit energy, commonly found in mobile devices and communication systems.
💡This principle is at the core of #CyberCharge, our innovative Web3 charger.
🔋By combining low-voltage technology with #DePIN and blockchain, we've created the world's first Charge-to-Earn (C2E) charger—secure, portable, and reliable.
#Lowvoltage#Web3#charger
Like👍, Retweet🔵, Comment
Link to the Tweet!