summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2012-10-09 14:18:16 (GMT)
committerEli Bendersky <eliben@gmail.com>2012-10-09 14:18:16 (GMT)
commit831893a68ec7114c1fc9c8e36b9159f5c1db50c7 (patch)
tree1a1af167e33f192e78b4293d9a2f5d4f3fa41805 /Doc
parent323a43af0639883220227424e6aee474bfde55f7 (diff)
downloadcpython-831893a68ec7114c1fc9c8e36b9159f5c1db50c7.zip
cpython-831893a68ec7114c1fc9c8e36b9159f5c1db50c7.tar.gz
cpython-831893a68ec7114c1fc9c8e36b9159f5c1db50c7.tar.bz2
Issue #16082: clarify the documentation of tostring[list] saying that it may generate a bytestring, depending on the given encoding.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/xml.etree.elementtree.rst16
1 files changed, 8 insertions, 8 deletions
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index cd4a490..26f1fbe 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -433,9 +433,9 @@ Functions
Generates a string representation of an XML element, including all
subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is
the output encoding (default is US-ASCII). Use ``encoding="unicode"`` to
- generate a Unicode string. *method* is either ``"xml"``,
- ``"html"`` or ``"text"`` (default is ``"xml"``). Returns an (optionally)
- encoded string containing the XML data.
+ generate a Unicode string (otherwise, a bytestring is generated). *method*
+ is either ``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``).
+ Returns an (optionally) encoded string containing the XML data.
.. function:: tostringlist(element, encoding="us-ascii", method="xml")
@@ -443,11 +443,11 @@ Functions
Generates a string representation of an XML element, including all
subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is
the output encoding (default is US-ASCII). Use ``encoding="unicode"`` to
- generate a Unicode string. *method* is either ``"xml"``,
- ``"html"`` or ``"text"`` (default is ``"xml"``). Returns a list of
- (optionally) encoded strings containing the XML data. It does not guarantee
- any specific sequence, except that ``"".join(tostringlist(element)) ==
- tostring(element)``.
+ generate a Unicode string (otherwise, a bytestring is generated). *method*
+ is either ``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``).
+ Returns a list of (optionally) encoded strings containing the XML data.
+ It does not guarantee any specific sequence, except that
+ ``"".join(tostringlist(element)) == tostring(element)``.
.. versionadded:: 3.2