[docs] [issue21279] str.translate documentation incomplete

John Posner report at bugs.python.org
Mon Dec 15 14:38:48 CET 2014


John Posner added the comment:

Kindly ignore message #2 on the Rietveld page (sorry for the channel noise). Here's my suggested revision:

Return a copy of the string *str* in which each character has been mapped through the given translation *table*. The table must be a subscriptable object, for instance a list or dictionary; when subscripted (indexed) by a Unicode ordinal (an integer in range(1048576)), the table object can:

* return a Unicode ordinal or a string, to map the character to one or more other characters.

* return None, to delete the character from the return string.

* raise a LookupError (possibly an instance of subclass IndexError or KeyError), to map the character to itself.

----------
nosy: +jjposner

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21279>
_______________________________________


More information about the docs mailing list