[Python-Dev] Sharing expat instances

Scott David Daniels Scott.Daniels at Acm.Org
Wed Dec 14 18:56:50 CET 2005


Fredrik Lundh wrote:
> Phillip J. Eby wrote.
> 
>>> my current idea is to
>>>
>>>     1.  include it under a different name (_elementtree.so)
>>>     2.  add a cElementTree.py under xml.etree, which simply does
>>>             from _elementtree import *
>>>
>>> does anyone have a better idea ?
>> I was under the impression that simply installing cElementTree.so in the
>> relevant package directory would work; this is what the distutils do for
>> extensions with a package name.
> 
> it would work, of course, but the core puts all the binaries in a separate
> directory (lib-dynload on unix, DLLs on windows, etc).

One good reason for this is that the .pyd's or .so's cannot necessarily
be used from zip files, so it is nice to keep those binaries out of the
package directory (packages can then easily go in a Python25.zip).
My (admittedly weak) understanding of how packages work is that all
parts of a package should lie off the same node of the PYTHONPATH.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-Dev mailing list