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

Skip to content

Commit bfd7837

Browse files
committed
Clarify the documentation of XMLParser.close
The return value of close() is not always a toplevel element. It depends on what the underlying target returns. By default, TreeBuilder returns the toplevel document element.
1 parent 1544fc5 commit bfd7837

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Doc/library/xml.etree.elementtree.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,9 @@ XMLParser Objects
982982

983983
.. method:: close()
984984

985-
Finishes feeding data to the parser. Returns an element structure.
985+
Finishes feeding data to the parser. Returns the result of calling the
986+
`close` method of the *target* passed during construction; by default,
987+
this is the toplevel document element.
986988

987989

988990
.. method:: doctype(name, pubid, system)

0 commit comments

Comments
 (0)