[Python-Dev] New and Improved Import Hooks

Martin v. Löwis martin@v.loewis.de
05 Dec 2002 23:38:50 +0100


"Steve Holden" <sholden@holdenweb.com> writes:

> > >Should be "importing_module_from_dlls".
> >
> > I still don't understand. Is that some feature of Python?
> >
> I think Wiktor is referring to extensions, which under Windows are often
> provided as .pyd DLLs.

Yes, but then I understand how that is related to zipfile imports: A
.pyd provides only a single module. A .zip file must supply many
modules.

> A quick look at my own code base, admittedly puny, reveals no statements
> that would break were non-strings to be added to sys.path. Is there some way
> to trap assignments to sys.path so a warning could be issued if sufficiently
> un-stringy elements were discovered in it? 

This isn't really possible, as this is just a dict
modification. You'ld also have to catch assignments to
sys.__dict__['path']

Regards,
Martin