Reference implementation of an import hook

N

Noam Raphael

Hello,

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 modules will be imported in the same way they are
currently imported.

I want it so that it would be easy for me to change it, or subclass it,
for my own needs, while preserving its behaviour. (The situation, if you
are interested, is that currently modules are loaded from the network,
which takes a long time, and I want to create a caching mechanism which
will use the local hard-disk.)

Thank you,
Noam Raphael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top