A smarter(?) package importer.

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Wed Nov 7 08:55:34 EST 2001


>>>>> "GMcM" == Gordon McMillan <gmcm at hypernet.com> writes:

    GMcM> But sys.modules is a dictionary. It's hashed, not scanned.

Indeed but doesn't the length of the table matter for performance?  I
am no expert here so I'm just asking.

    GMcM> If you *don't* cache failure, you get 3 (4 on Windows)
    GMcM> attempted opens per directory that you could have avoided.

Yes, thats a problem, didn't look hard enough. Thanks for pointing it
out.  Okay I'm convinced of caching now.  Will try to cache it and
post an updated version.

thanks,
prabhu




More information about the Python-list mailing list