[Python-Dev] why is mmap a builtin module on windows?

Christian Heimes lists at cheimes.de
Wed Jan 23 09:01:32 CET 2008


Ralf Schmitt wrote:
> Hi all,
> 
> I want to use the mmap module from python trunk with python 2.5.
> On Linux I can easily replace it, as it is a dynamically loaded module. On
> windows
> it is a builtin module and I fear that I must compile python on windows (or
> resort to some other ugly hack)
> 
> What is the reason for mmap being a builtin module?

On Windows lots of modules are linked into the python main dll. The file
PC/config.c contains a list of all modules. From the point of the
maintainer it's much easier to link the modules into the main dll
instead of creating standalone dlls. I also suspect that it's much
faster because relocation is slow (see PC/dllbase_nt.txt). Martin or
Mark can give you a better answer.

Why do you want to overwrite the existing module instead of using a
different name like ralfmmap?

import ralfmmap as mmap
sys.modules]'mmap'] = mmap

Christian



More information about the Python-Dev mailing list