Patch #1071: Improve unicode.translate() so that you can pass unicode

characters as mapping keys and invalid mapping keys are recognized
and raise an error.
This commit is contained in:
Georg Brandl 2007-10-23 06:52:59 +00:00
parent 3b8cb17695
commit 94c2c75b5e
3 changed files with 52 additions and 6 deletions

View file

@ -931,7 +931,7 @@ functions based on regular expressions.
Return a copy of the *s* where all characters have been mapped through the
*map* which must be a dictionary of characters (strings of length 1) or
Unicode ordinals (integers) to Unicode ordinals, strings or ``None``.
Unmapped characters are left untouched. Characters mapped to ``None`` are
Unmapped characters are left untouched. Characters mapped to ``None`` are
deleted.
.. note::