File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -873,13 +873,16 @@ \section{Built-in Functions \label{built-in-funcs}}
873873 behaviour of \code {str()} except that it returns Unicode strings
874874 instead of 8-bit strings. More precisely, if \var {object} is an
875875 Unicode string or subclass it will return a Unicode string without
876- any additional decoding applied. For objects which provide a
877- \code {__unicode__} method, it will call this method without
878- arguments to create a Unicode string. For all other objects, the
879- 8-bit string version or representation is requested and then
880- converted to a Unicode string using the codec for the default
881- encoding in \code {'strict'} mode.
876+ any additional decoding applied.
877+
878+ For objects which provide a \method {__unicode__()} method, it will
879+ call this method without arguments to create a Unicode string. For
880+ all other objects, the 8-bit string version or representation is
881+ requested and then converted to a Unicode string using the codec for
882+ the default encoding in \code {'strict'} mode.
883+
882884 \versionadded {2.0}
885+ \versionchanged [Support for \method {__unicode__()} added]{2.2}
883886\end {funcdesc }
884887
885888\begin {funcdesc }{vars}{\optional {object}}
You can’t perform that action at this time.
0 commit comments