
Greg Stein wrote:
* A separate importer to just load dynamic libraries: this would need to replicate PathImporter's mapping of Python module/package hierarchy onto the filesystem. There would also be a sequencing issue because one Importer's paths would be searched before the other's paths. Current Python import rules establishes that a module earlier in sys.path (whether a dyn-lib or not) is loaded before one later in the path. This behavior could be broken if two Importers were used.
I would like to argue that on Windows, import of dynamic libraries is broken. If a file something.pyd is imported, then sys.path is searched to find the module. If a file something.dll is imported, the same thing happens. But Windows defines its own search order for *.dll files which Python ignores. I would suggest that this is wrong for files named *.dll, but OK for files named *.pyd. A SysAdmin should be able to install and maintain *.dll as she has been trained to do. This makes maintaining Python installations simpler and more un-surprising. I have no solution to the backward compatibilty problem. But the code is only a couple lines. A LoadLibrary() call does its own path searching. Jim Ahlstrom