logoalt Hacker News

rad120today at 12:17 PM5 repliesview on HN

Python is such a weird language. Lazy imports are a bandaid for AI code base monstrosities with 1000 imports (1% of which are probably Shai Hulud now).

And now even type imports are apparently so slow that you have to disable them if unused during the normal untyped execution.

If Instagram or others wants a professional language, they should switch to Go or PHP instead of shoehorning strange features into a language that wasn't built for their use cases.


Replies

stingraycharlestoday at 12:20 PM

> Python is such a weird language. Lazy imports are a bandaid for AI code base monstrosities with 1000 imports

Just because you don’t like a feature doesn’t mean it’s because of AI and bad code.

show 3 replies
novovtoday at 12:36 PM

Empirically, I have used the current accepted way to do lazy imports (import statement inside a function) before AI coding was even a mainstream thing, for personal code that sometimes needs a heavy import and sometimes doesn’t.

The lazy statement would be an improvement as it allows one to see all the imports at the top where you expect them to be.

show 1 reply
formerly_proventoday at 12:42 PM

On most unix-likes all "imports" via shared libraries (e.g. in C / C++) are lazy by default.