Issue #16082: clarify the documentation of tostring[list] saying that it may generate a bytestring, depending on the given encoding.

This commit is contained in:
Eli Bendersky 2012-10-09 07:18:16 -07:00
parent 323a43af06
commit 831893a68e
1 changed files with 8 additions and 8 deletions

View File

@ -433,9 +433,9 @@ Functions
Generates a string representation of an XML element, including all Generates a string representation of an XML element, including all
subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is
the output encoding (default is US-ASCII). Use ``encoding="unicode"`` to the output encoding (default is US-ASCII). Use ``encoding="unicode"`` to
generate a Unicode string. *method* is either ``"xml"``, generate a Unicode string (otherwise, a bytestring is generated). *method*
``"html"`` or ``"text"`` (default is ``"xml"``). Returns an (optionally) is either ``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``).
encoded string containing the XML data. Returns an (optionally) encoded string containing the XML data.
.. function:: tostringlist(element, encoding="us-ascii", method="xml") .. function:: tostringlist(element, encoding="us-ascii", method="xml")
@ -443,11 +443,11 @@ Functions
Generates a string representation of an XML element, including all Generates a string representation of an XML element, including all
subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is
the output encoding (default is US-ASCII). Use ``encoding="unicode"`` to the output encoding (default is US-ASCII). Use ``encoding="unicode"`` to
generate a Unicode string. *method* is either ``"xml"``, generate a Unicode string (otherwise, a bytestring is generated). *method*
``"html"`` or ``"text"`` (default is ``"xml"``). Returns a list of is either ``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``).
(optionally) encoded strings containing the XML data. It does not guarantee Returns a list of (optionally) encoded strings containing the XML data.
any specific sequence, except that ``"".join(tostringlist(element)) == It does not guarantee any specific sequence, except that
tostring(element)``. ``"".join(tostringlist(element)) == tostring(element)``.
.. versionadded:: 3.2 .. versionadded:: 3.2