|
From: Waylan L. <wa...@gm...> - 2008-07-04 14:06:28
|
On Fri, Jul 4, 2008 at 9:05 AM, Artem Yunusov <ne...@gm...> wrote: > > lxml supports ElementTree API, so we could write something like this: > > try: > from lxml import etree > print "running with lxml.etree" > except ImportError: > try: > # Python 2.5 > import xml.etree.cElementTree as etree > print "running with cElementTree on Python 2.5+" > except ImportError: > try: > # Python 2.5 > import xml.etree.ElementTree as etree > print "running with ElementTree on Python 2.5+" > except ImportError: > try: > # normal cElementTree install > import cElementTree as etree > print "running with cElementTree" > except ImportError: > try: > # normal ElementTree install > import elementtree.ElementTree as etree > print "running with ElementTree" > except ImportError: > print "Failed to import ElementTree from any known place" > > We can suggest to use lxml, but by default cElementTree will be used on > python 2.5 I like it. However, we should check that lxml is actually making a noticeable difference before we commit to that in a release. Unless Yuri objects, go ahead and implement it in a branch and well see how it goes. > I didn't get what the real problem with unicode is, there are some > general words at lxml site, and I think if the problem had been quite > serious, ElementTree wouldn't have included in standard Python library. > I tried some test with russian unicode data - didin't find any problems > yet, but I think this issue need more proper investigation. I get the impression that those comments were referring to the parser, not the serializer. If I'm understanding that correctly, then this should be a non-issue. But we should make sure. -- ---- Waylan Limberg wa...@gm... |