diff Doc/lib/libstdtypes.tex @ 29893:e9dddfd2a62f legacy-trunk

Discussion of signatures for unicode.translate() and str.translate() were in the wrong file. Moved out of libstring.tex and into libstdtypes.tex.
author Raymond Hettinger <python@rcn.com>
date Wed, 16 Jul 2003 05:11:27 +0000
parents 8807e901c526
children e3c9b48de60a
line wrap: on
line diff
--- a/Doc/lib/libstdtypes.tex	Wed Jul 16 04:34:56 2003 +0000
+++ b/Doc/lib/libstdtypes.tex	Wed Jul 16 05:11:27 2003 +0000
@@ -740,6 +740,16 @@
 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}{}