File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -276,7 +276,17 @@ \section{\module{string} ---
276276 Delete all characters from \var {s} that are in \var {deletechars} (if
277277 present), and then translate the characters using \var {table}, which
278278 must be a 256-character string giving the translation for each
279- character value, indexed by its ordinal.
279+ character value, indexed by its ordinal.
280+
281+ For Unicode objects, the \method {translate()} method does not
282+ accept the optional \var {deletechars} argument. Instead, it
283+ returns a copy of the \var {s} where all characters have been mapped
284+ through the given translation table which must be a mapping of
285+ Unicode ordinals to Unicode ordinals, Unicode strings or \code {None}.
286+ Unmapped characters are left untouched. Characters mapped to \code {None}
287+ are deleted. Note, a more flexible approach is to create a custom
288+ character mapping codec using the \refmodule {codecs} module (see
289+ \module {encodings.cp1251} for an example).
280290\end {funcdesc }
281291
282292\begin {funcdesc }{upper}{s}
You can’t perform that action at this time.
0 commit comments