[MERGE] import both c-extension and python module with the same name for testing

Lukáš Lalinský lalinsky at gmail.com
Thu Aug 9 10:10:56 BST 2007


On Št, 2007-08-09 at 10:55 +1000, Martin Pool wrote:
> 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
> 
[...]
> 
> Anything else?

Bzrlib already has two Pyrex extensions, but it is likely that there
will be more of them in the future. What about compiling them all into a
single extension (e.g. bzrlib._ext). The modules contain quite low-level
code which needs to be imported in almost all cases, anyway. I'm not
sure how big overhead have dynamic linkers on all bzr-supported
platforms, but I expect it to be bigger than for example the overhead of
try/except in case of importing the Python modules.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Toto je =?ISO-8859-1?Q?digit=E1lne?=
	=?ISO-8859-1?Q?_podp=EDsan=E1?= =?UTF-8?Q?_=C4=8Das=C5=A5?=
	=?ISO-8859-1?Q?_spr=E1vy?=
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070809/26285afe/attachment.pgp 


More information about the bazaar mailing list