mirror of
https://github.com/python/cpython.git
synced 2025-11-11 22:55:08 +00:00
Clarify the version information for the unicode() built-in.
Closes SF bug #575272.
This commit is contained in:
parent
1969817486
commit
78e057a32a
1 changed files with 9 additions and 6 deletions
|
|
@ -873,13 +873,16 @@ def my_import(name):
|
||||||
behaviour of \code{str()} except that it returns Unicode strings
|
behaviour of \code{str()} except that it returns Unicode strings
|
||||||
instead of 8-bit strings. More precisely, if \var{object} is an
|
instead of 8-bit strings. More precisely, if \var{object} is an
|
||||||
Unicode string or subclass it will return a Unicode string without
|
Unicode string or subclass it will return a Unicode string without
|
||||||
any additional decoding applied. For objects which provide a
|
any additional decoding applied.
|
||||||
\code{__unicode__} method, it will call this method without
|
|
||||||
arguments to create a Unicode string. For all other objects, the
|
For objects which provide a \method{__unicode__()} method, it will
|
||||||
8-bit string version or representation is requested and then
|
call this method without arguments to create a Unicode string. For
|
||||||
converted to a Unicode string using the codec for the default
|
all other objects, the 8-bit string version or representation is
|
||||||
encoding in \code{'strict'} mode.
|
requested and then converted to a Unicode string using the codec for
|
||||||
|
the default encoding in \code{'strict'} mode.
|
||||||
|
|
||||||
\versionadded{2.0}
|
\versionadded{2.0}
|
||||||
|
\versionchanged[Support for \method{__unicode__()} added]{2.2}
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{vars}{\optional{object}}
|
\begin{funcdesc}{vars}{\optional{object}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue