gh-151943: Document the CharacterData interface and other DOM members… · python/cpython@922c866

GitHub

@@ -245,11 +245,24 @@ rules apply:

245245 Instead, :mod:`!xml.dom.minidom` uses standard Python exceptions such as

246246:exc:`TypeError` and :exc:`AttributeError`.

247247248-* :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+* Each of the :class:`~xml.dom.NodeList` and :class:`~xml.dom.NamedNodeMap`

249+ interfaces has two implementations, which provide additional methods and

250+ operations.

251+252+:attr:`~xml.dom.Node.childNodes` is a subclass of :class:`list`, or, for

253+ nodes which cannot have children, a subclass of :class:`tuple`.

254+ It supports iteration, concatenation, indexing and slicing.

255+256+:attr:`~xml.dom.Node.attributes` supports ``len()``, the :keyword:`in`

257+ operator, subscription by a name or by a ``(namespaceURI, localName)``

258+ tuple, assignment and deletion, and the methods :meth:`!get`, :meth:`!keys`,

259+:meth:`!keysNS`, :meth:`!values`, :meth:`!items` and :meth:`!itemsNS`.

260+:attr:`~xml.dom.DocumentType.entities` and

261+:attr:`~xml.dom.DocumentType.notations` are read-only and support only

262+ ``len()`` and subscription by a name.

263+264+* :attr:`~xml.dom.Document.strictErrorChecking` and

265+:attr:`~xml.dom.Attr.specified` are always ``False``.

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

255268