Многие из тех кто активно работал с 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 Daily Gwei (🔗YouTube)
🔗ETH infinite bid, Ethereum's next 10 years and more - The Daily Gwei Refuel #845 - Ethereum Updates
Subscribe to the newsletter: https://thedailygwei.substack.com
Follow me on Twitter: https://twitter.com/sassal0x
Follow The Daily Gwei on Twitter: https://twitter.com/thedailygwei and https://twitter.com/DailyGwei_TV
Join the Discord channel: https://discord.gg/4pfUJsENcg
--------------------------------------------------
The Daily Gwei Refuel gives you a recap every week day on everything that happened in the Ethereum and crypto ecosystems over the previous 24 hours - hosted by Anthony Sassano.
--------------------------------------------------
Timestamps and links 👇
00:00 Introductory song
https://x.com/sassal0x/status/1955246612789465572
01:40 ETH treasury companies on fire
https://x.com/SERdotxyz/status/1955458142977810600
17:14 The ETH ETFs seeing record flows
https://x.com/sassal0x/status/1955461999862878368
23:21 The SEC's...
View original post
~
₿izFeed#⃣:#daily
OKX XP Marathon - S3
Run the long game 🏃🏻♀️🏃🏻♀️🏃🏻♀️
Prize:
250 USDT waiting for you to win!
🥇 1st : 60 USDT
🥈 2nd : 50 USDT
🥉 3rd : 40 USDT
🎁 4th : 30 USDT
🎁 5th : 20 USDT
🎁 6th–10th : 10 USDT each
How to earn points👇
1. Sign up on OKX (If you haven’t already)
2. Join & stay in OKX Global Discord (Must)
3. Chat actively in #general-chat to earn XP🏆 and use the hashtag # XPMarathonS3
4. Valid messages only (No spam, No links)
5. Send 'Win XP' to #daily-check-in to earn extra points 👉 100xp
6. Submit this Form for reward distribution
📆 Event Period: 4/2/2025, 9:30 AM - 13/2/2026, 6:00 PM (GMT+8)
👇
Join now
Our Socials:
⚜️Sign Up on OKX | Join Affiliate | TG | DC | Wallet TG | Wallet Announcement | OKX on Spotify | Twitter/X | YouTube
⭐️CN DC | CN TG
‼️Please check the authenticity of all OKX links or channels at OKX channel verification