Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 323a43a

Browse files
committed
Issue #12322: clarify xpath reference for cases where the path reaches ancestors of the start element. Also add missing markup for a None. Thanks to patrick vrijlandt and Mike Hoy for the report and initial patches.
1 parent ea69bd3 commit 323a43a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Doc/library/xml.etree.elementtree.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ Supported XPath syntax
291291
| | current element. For example, ``.//egg`` selects |
292292
| | all ``egg`` elements in the entire tree. |
293293
+-----------------------+------------------------------------------------------+
294-
| ``..`` | Selects the parent element. |
294+
| ``..`` | Selects the parent element. Returns ``None`` if the |
295+
| | path attempts to reach the ancestors of the start |
296+
| | element (the element ``find`` was called on). |
295297
+-----------------------+------------------------------------------------------+
296298
| ``[@attrib]`` | Selects all elements that have the given attribute. |
297299
+-----------------------+------------------------------------------------------+
@@ -521,7 +523,7 @@ Element Objects
521523
.. method:: clear()
522524

523525
Resets an element. This function removes all subelements, clears all
524-
attributes, and sets the text and tail attributes to None.
526+
attributes, and sets the text and tail attributes to ``None``.
525527

526528

527529
.. method:: get(key, default=None)

0 commit comments

Comments
 (0)