[Python-checkins] python/dist/src/Doc/lib libfuncs.tex, 1.175.2.7, 1.175.2.8

fdrake@users.sourceforge.net fdrake at users.sourceforge.net
Tue Aug 23 06:35:32 CEST 2005


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21972/lib

Modified Files:
      Tag: release24-maint
	libfuncs.tex 
Log Message:
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
(backported from trunk revision 1.188)


Index: libfuncs.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v
retrieving revision 1.175.2.7
retrieving revision 1.175.2.8
diff -u -d -r1.175.2.7 -r1.175.2.8
--- libfuncs.tex	21 Aug 2005 11:59:04 -0000	1.175.2.7
+++ libfuncs.tex	23 Aug 2005 04:35:22 -0000	1.175.2.8
@@ -678,11 +678,16 @@
 \end{funcdesc}
 
 \begin{funcdesc}{ord}{c}
-  Return the \ASCII{} value of a string of one character or a Unicode
-  character.  E.g., \code{ord('a')} returns the integer \code{97},
+  Given a string of length one, return an integer representing the
+  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
-  \function{chr()} for strings and of \function{unichr()} for Unicode
-  characters.
+  \function{chr()} for 8-bit strings and of \function{unichr()} for unicode
+  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}
 
 \begin{funcdesc}{pow}{x, y\optional{, z}}



More information about the Python-checkins mailing list