]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Discussion of signatures for unicode.translate() and str.translate()
authorRaymond Hettinger <python@rcn.com>
Wed, 16 Jul 2003 05:11:27 +0000 (05:11 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 16 Jul 2003 05:11:27 +0000 (05:11 +0000)
were in the wrong file.  Moved out of libstring.tex and into
libstdtypes.tex.

Doc/lib/libstdtypes.tex
Doc/lib/libstring.tex

index 2b64d892deb7850db4ecf78db989ec94fbf37418..2f01ca6d89672690137f02d96107c4db33d49833 100644 (file)
@@ -740,6 +740,16 @@ Return a copy of the string where all characters occurring in the
 optional argument \var{deletechars} are removed, and the remaining
 characters have been mapped through the given translation table, which
 must be a string of length 256.
+
+For Unicode objects, the \method{translate()} method does not
+accept the optional \var{deletechars} argument.  Instead, it
+returns a copy of the \var{s} where all characters have been mapped
+through the given translation table which must be a mapping of
+Unicode ordinals to Unicode ordinals, Unicode strings or \code{None}.
+Unmapped characters are left untouched. Characters mapped to \code{None}
+are deleted.  Note, a more flexible approach is to create a custom
+character mapping codec using the \refmodule{codecs} module (see
+\module{encodings.cp1251} for an example).      
 \end{methoddesc}
 
 \begin{methoddesc}[string]{upper}{}
index f017aa8e1311c1056b639d6161a3e043620ebf6e..6c3dc4dc21d7e190c2c4dd3d2896afd5870e77cd 100644 (file)
@@ -277,16 +277,6 @@ parameter cannot be passed in earlier 2.2 versions]{2.2.3}
   present), and then translate the characters using \var{table}, which 
   must be a 256-character string giving the translation for each
   character value, indexed by its ordinal.
-
-  For Unicode objects, the \method{translate()} method does not
-  accept the optional \var{deletechars} argument.  Instead, it
-  returns a copy of the \var{s} where all characters have been mapped
-  through the given translation table which must be a mapping of
-  Unicode ordinals to Unicode ordinals, Unicode strings or \code{None}.
-  Unmapped characters are left untouched. Characters mapped to \code{None}
-  are deleted.  Note, a more flexible approach is to create a custom
-  character mapping codec using the \refmodule{codecs} module (see
-  \module{encodings.cp1251} for an example).
 \end{funcdesc}
 
 \begin{funcdesc}{upper}{s}