Movatterモバイル変換
[0]ホーム
[Python-Dev] folding cElementTree behind ElementTree in 3.3
Eli Benderskyeliben at gmail.com
Wed Feb 8 08:31:16 CET 2012
>> The facade can be added to xml/etree/ElementTree.py since that's the>> only documented module. It can attempt to do:>>>> from _elementtree import *>>>> (which is what cElementTree.py) does, and on failure, just go on doing>> what it does now.>> Basically, cElementTree (actually the accelerator module) reuses everything> from ElementTree that it does not implement itself, e.g. the serialiser or> the ElementPath implementation in ElementPath.py (which is not commonly> being used by itself anyway).>> ElementInclude is meant to be independently imported by user code and works> with both implementations, although it uses plain ElementTree by default> and currently needs explicit configuring for cElementTree. It looks like> that need would vanish when ElementTree uses the accelerator module internally.>> So, ElementTree.py is a superset of cElementTree's C module, and importing> that C module into ElementTree.py instead of only importing it into> cElementTree.py would just make ElementTree.py faster, that's basically it.>Yep. Any objections from pydev?Stefan, in the other thread (... XML batteries ) you said you willcontact Fredrik, did you manage to get hold of him?Eli
More information about the Python-Devmailing list
[8]ページ先頭