@@ -13477,20 +13477,21 @@ unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z)
1347713477str.translate as unicode_translate
1347813478
1347913479 table: object
13480- Translation table, which must be a mapping of Unicode ordinals to
13481- Unicode ordinals, strings, or None .
13480+ Translation table, which must be an object that implements indexing via __getitem__(),
13481+ typically a mapping or sequence .
1348213482 /
1348313483
1348413484Replace each character in the string using the given translation table.
1348513485
1348613486The table must implement lookup/indexing via __getitem__, for instance a
13487- dictionary or list. If this operation raises LookupError, the character is
13488- left untouched. Characters mapped to None are deleted.
13487+ dictionary or list. When indexed by a Unicode ordinal, it may return another
13488+ Unicode ordinal or a string to replace the character, return None to delete
13489+ it, or raise LookupError to leave it unchanged.
1348913490[clinic start generated code]*/
1349013491
1349113492static PyObject *
1349213493unicode_translate (PyObject * self , PyObject * table )
13493- /*[clinic end generated code: output=3cb448ff2fd96bf3 input=6d38343db63d8eb0 ]*/
13494+ /*[clinic end generated code: output=3cb448ff2fd96bf3 input=6bb9205d97271b8b ]*/
1349413495{
1349513496 return _PyUnicode_TranslateCharmap (self , table , "ignore" );
1349613497}
0 commit comments