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

Skip to content

Commit 9e189f0

Browse files
Cleanup the docs ElementTree a bit.
2 parents e9af827 + f1b045f commit 9e189f0

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

Doc/library/xml.etree.elementtree.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ Functions
428428
arguments. Returns an element instance.
429429

430430

431-
.. function:: tostring(element, encoding="us-ascii", method="xml", *,\
431+
.. function:: tostring(element, encoding="us-ascii", method="xml", *, \
432432
short_empty_elements=True)
433433

434434
Generates a string representation of an XML element, including all
@@ -443,7 +443,7 @@ Functions
443443
The *short_empty_elements* parameter.
444444

445445

446-
.. function:: tostringlist(element, encoding="us-ascii", method="xml", *,\
446+
.. function:: tostringlist(element, encoding="us-ascii", method="xml", *, \
447447
short_empty_elements=True)
448448

449449
Generates a string representation of an XML element, including all
@@ -751,8 +751,8 @@ ElementTree Objects
751751
section root element.
752752

753753

754-
.. method:: write(file, encoding="us-ascii", xml_declaration=None,\
755-
default_namespace=None, method="xml", *,\
754+
.. method:: write(file, encoding="us-ascii", xml_declaration=None, \
755+
default_namespace=None, method="xml", *, \
756756
short_empty_elements=True)
757757
758758
Writes the element tree to a file, as XML. *file* is a file name, or a
@@ -761,9 +761,9 @@ ElementTree Objects
761761
*xml_declaration* controls if an XML declaration should be added to the
762762
file. Use ``False`` for never, ``True`` for always, ``None``
763763
for only if not US-ASCII or UTF-8 or Unicode (default is ``None``).
764+
*default_namespace* sets the default XML namespace (for "xmlns").
764765
*method* is either ``"xml"``, ``"html"`` or ``"text"`` (default is
765-
``"xml"``). *default_namespace* sets the default XML namespace (for
766-
"xmlns").
766+
``"xml"``).
767767
The keyword-only *short_empty_elements* parameter controls the formatting
768768
of elements that contain no content. If *True* (the default), they are
769769
emitted as a single self-closed tag, otherwise they are emitted as a pair

Lib/xml/etree/ElementTree.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -785,16 +785,16 @@ def write(self, file_or_filename,
785785
default_namespace=None,
786786
method=None, *,
787787
short_empty_elements=True):
788-
"""Write the element tree to a file, as XML. 'file_or_filename' is a
789-
file name or a file object opened for writing. 'encoding' is the
790-
output encoding (default is US-ASCII). 'xml_declaration' controls
791-
if an XML declaration should be added to the output. Use False
792-
for never, True for always, None for only if not US-ASCII or
793-
UTF-8 or Unicode (default is None). 'method' is either "xml"
794-
(default), "html", "text" or "c14n".
788+
"""Write the element tree to a file, as XML. 'file_or_filename' is a
789+
file name or a file object opened for writing.
790+
'encoding' is the output encoding (default is US-ASCII).
791+
'xml_declaration' controls if an XML declaration should be added
792+
to the output. Use False for never, True for always, None for only
793+
if not US-ASCII or UTF-8 or Unicode (default is None).
795794
'default_namespace' sets the default XML namespace (for "xmlns").
795+
'method' is either "xml" (default), "html", "text" or "c14n".
796796
The keyword-only 'short_empty_elements' parameter controls the
797-
formatting of elements that contain no content. If True (default),
797+
formatting of elements that contain no content. If True (default),
798798
they are emitted as a single self-closed tag, otherwise they are
799799
emitted as a pair of start/end tags.
800800

0 commit comments

Comments
 (0)