Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> To do that on a module, you have to first import that module - and then all the imports at the top of it would've already run.

Why not just replace the `__import__` function at program startup, when you haven't imported anything? Monkey patching `__import__` at any other time seems like a bad idea.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: