mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
ord() documentation update; this is what remains applicable from
SF patch #1057588; other changes make the rest of the patch out of date or otherwise unnecessary
This commit is contained in:
parent
7ed44e52aa
commit
b406905f33
1 changed files with 9 additions and 4 deletions
|
@ -716,11 +716,16 @@ class C:
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{ord}{c}
|
\begin{funcdesc}{ord}{c}
|
||||||
Return the \ASCII{} value of a string of one character or a Unicode
|
Given a string of length one, return an integer representing the
|
||||||
character. E.g., \code{ord('a')} returns the integer \code{97},
|
Unicode code point of the character when the argument is a unicode object,
|
||||||
|
or the value of the byte when the argument is an 8-bit string.
|
||||||
|
For example, \code{ord('a')} returns the integer \code{97},
|
||||||
\code{ord(u'\e u2020')} returns \code{8224}. This is the inverse of
|
\code{ord(u'\e u2020')} returns \code{8224}. This is the inverse of
|
||||||
\function{chr()} for strings and of \function{unichr()} for Unicode
|
\function{chr()} for 8-bit strings and of \function{unichr()} for unicode
|
||||||
characters.
|
objects. If a unicode argument is given and Python was built with
|
||||||
|
UCS2 Unicode, then the character's code point must be in the range
|
||||||
|
[0..65535] inclusive; otherwise the string length is two, and a
|
||||||
|
\exception{TypeError} will be raised.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{pow}{x, y\optional{, z}}
|
\begin{funcdesc}{pow}{x, y\optional{, z}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue