[MERGE] import both c-extension and python module with the same name for testing
Martin Pool
mbp at sourcefrog.net
Thu Aug 9 01:55:22 BST 2007
To try and summarize the thread: there are a few choices
1- merge something like Alexander's patch; then any module that wants
a doubly-implemented module can just simply import it and will get
either the C or python version
2- put the try/import/except/import into things that need to import it
3- have a pure-python wrapper module that imports whichever
implementation is available
1 has the disadvantage that we're adding more code and the change
might not be needed
2 has the disadvantage that the code for modules that import C
extensions is more longwinded, and it may be very slightly slower
because of the try/except statement, and perhaps substantially slower
because probing for more files when loading the python version.
Although some compiled modules may be used from only one module (like
knit parsing), others like bencode may be more broadly used.
3 has the substantial disadvantage that we need to load an extra
python module and that causes many syscalls
Anything else?
--
Martin
More information about the bazaar
mailing list