A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-December/058582.html below:

[Python-Dev] ElementTree - Why not part of the core? (fwd)

[Python-Dev] ElementTree - Why not part of the core? (fwd) [Python-Dev] ElementTree - Why not part of the core? (fwd)Fredrik Lundh fredrik at pythonware.com
Mon Dec 12 12:14:33 CET 2005
Martin v. Löwis wrote:

> > Since all the relevant module names start with "Element", putting it directly
> > under xml wouldn't be too bad.  But an xml subpackage is better, and prior
> > art says "etree".
>
> So etree it is.

I just realized that the prior art (lxml.etree) uses etree as an alias for the
ElementTree module, not as a package name.  this means that to import the
core Element type, you'd do:

    # classic ET
    from elementtree.ElementTree import Element

or

    # bundled ET
    from xml.etree.ElementTree import Element

or

    # libxml-powered ET
    from lxml.etree import Element

or

    # accelerated ET
    from cElementTree import Element

I'm not sure if this really is a problem.  better explicit than implicit, as PyXML
has shown us.  if people want to be able to rapidly switch between versions,
they can always use from-import or import-as.

</F>



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4