Reference implementation of an import hook

Discussion in 'Python' started by Noam Raphael, Jun 21, 2004.

  1. Noam Raphael

    Noam Raphael Guest

    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
    Noam Raphael, Jun 21, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Pifer via .NET 247

    Hook JScript Client Events to Server Controls

    David Pifer via .NET 247, May 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,785
    David Jessee
    May 2, 2004
  2. Torsten Mohr

    import hook, overwrite import?

    Torsten Mohr, Jan 26, 2005, in forum: Python
    Replies:
    2
    Views:
    435
    Steve Holden
    Jan 27, 2005
  3. Jeremy Sanders

    import hook

    Jeremy Sanders, Jun 11, 2006, in forum: Python
    Replies:
    4
    Views:
    383
    Jeremy Sanders
    Jun 18, 2006
  4. Andrea Crotti

    simple import hook

    Andrea Crotti, Nov 10, 2011, in forum: Python
    Replies:
    0
    Views:
    134
    Andrea Crotti
    Nov 10, 2011
  5. Andrea Crotti
    Replies:
    0
    Views:
    149
    Andrea Crotti
    Jan 19, 2012
Loading...

Share This Page