[Python-Dev] elementtree in stdlib

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Apr 7 02:47:53 CEST 2006


Trent Mick wrote:

>     try:
>         import xml.etree.ElementTree as ET # in python >=2.5
>     except ImportError:
 >        ... etc ad nauseam

For situations like this I've thought it might
be handy to be able to say

   import xml.etree.ElementTree or cElementTree or \
     elementtree.ElementTree or lxml.etree as ET

--
Greg


More information about the Python-Dev mailing list