Hello, I've sent this question to comp.lang.python and didn't get any response. Do you know of a reference implementation of an import hook? I mean a class, written in Python, that imitates Python's default module loading behaviour. I mean that I would be able to append the class to sys.path_hooks, and module loading won't be affected. I want it so that it would be easy for me to modify it, or subclass it, for my own needs, while preserving its behaviour. (My situation, if you are interested, is that in my current setup, modules are loaded from the network, which takes a long time. I want to create a caching mechanism which will use the local hard disk.) It seems to me that such an implementation should be added to the standard library or at least to the documentation, since it would help anyone who would like to write an import hook, and would also help clarify Python's import mechanism. If such an implementation doesn't exist, I would probably write one anyway, and I would be willing to share it, if people want it. Thank you, Noam Raphael
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4