Skip to content

Commit d67e631

Browse files
gh-151943: Clarify how minidom implements NodeList
It is a list subclass, not a replacement for NodeList, and nodes which cannot have children use a tuple subclass. Remove the note about earlier versions of Python which did not support the official API.
1 parent e48c25e commit d67e631

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Doc/library/xml.dom.minidom.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,12 @@ rules apply:
245245
Instead, :mod:`!xml.dom.minidom` uses standard Python exceptions such as
246246
:exc:`TypeError` and :exc:`AttributeError`.
247247

248-
* :class:`NodeList` objects are implemented using Python's built-in list type.
249-
These objects provide the interface defined in the DOM specification, but with
250-
earlier versions of Python they do not support the official API. They are,
251-
however, much more "Pythonic" than the interface defined in the W3C
252-
recommendations.
248+
* The :mod:`!xml.dom.minidom` implementation of :class:`~xml.dom.NodeList`
249+
is a subclass of :class:`list`.
250+
In addition to the interface defined in the DOM specification,
251+
it supports all list operations, which are much more "Pythonic".
252+
Nodes which cannot have children use another implementation,
253+
which is a subclass of :class:`tuple`.
253254

254255
The following interfaces have no implementation in :mod:`!xml.dom.minidom`:
255256

0 commit comments

Comments
 (0)