mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
This patch adds a new builtin unistr() which behaves like str()
except that it always returns Unicode objects. A new C API PyObject_Unicode() is also provided. This closes patch #101664. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
This commit is contained in:
parent
d5c43065d5
commit
ad7c98e264
10 changed files with 119 additions and 6 deletions
|
|
@ -694,6 +694,12 @@ to decode UTF-8 in strict mode, meaning that encoding errors raise
|
|||
\versionadded{2.0}
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{unistr}{object}
|
||||
Return a Unicode string containing a nicely printable representation of an
|
||||
object. For Unicode, this returns the Unicode string itself. For
|
||||
all other objects, it tries to convert \code{str(\var{object})] to Unicode.
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{vars}{\optional{object}}
|
||||
Without arguments, return a dictionary corresponding to the current
|
||||
local symbol table. With a module, class or class instance object as
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue