News for hackers. Stuff that matters.
Re:HRT's Python Fork: Leveraging PEP 690 for Faster Imports by 82716f12 on Friday August 08, 2025 @05:21PM (#44841811)
That sounds good in theory, but I haven’t come across a codebase that’s really optimized and free of unnecessary imports, especially in large companies.

And when you have to depend on external libraries beyond your control, how do you typically handle those situations?

Re:HRT's Python Fork: Leveraging PEP 690 for Faster Imports by ActorNightly on Friday August 08, 2025 @05:43PM (#44841989)
As codebases get larger, inefficiencies are bound to happen. Having explicit imports that I can go look up and see where they are is better for resolving this, because you can trace how every module gets imported and time them. Having interpreter code that runs with lazy loading that is all hidden is not the way to solve this.

As for external libraries, you import them in places where you need to use them only to avoid the same pitfalls. Its also pretty easy to analyze the import process within those libraries, and then again import specific submodules only that limit what actually gets loaded.