@@ -1487,17 +1487,21 @@ These are the mapping codec APIs:
14871487
14881488The following codec API is special in that maps Unicode to Unicode.
14891489
1490- .. c :function :: PyObject* PyUnicode_Translate (PyObject *unicode, \
1491- PyObject *mapping, const char *errors)
1490+ .. c :function :: PyObject* PyUnicode_Translate (PyObject *str, PyObject *table, const char *errors)
14921491
1493- Translate a Unicode object using the given * mapping * object and return the
1494- resulting Unicode object. Return ``NULL `` if an exception was raised by the
1492+ Translate a string by applying a character mapping table to it and return the
1493+ resulting Unicode object. Return ``NULL `` if an exception was raised by the
14951494 codec.
14961495
1497- The *mapping * object must map Unicode ordinal integers to Unicode strings,
1498- integers (which are then interpreted as Unicode ordinals) or ``None``
1499- (causing deletion of the character). Unmapped character ordinals (ones
1500- which cause a :exc: `LookupError `) are left untouched and are copied as-is.
1496+ The mapping table must map Unicode ordinal integers to Unicode ordinal integers
1497+ or ``None `` (causing deletion of the character).
1498+
1499+ Mapping tables need only provide the :meth:`__getitem__` interface; dictionaries
1500+ and sequences work well. Unmapped character ordinals (ones which cause a
1501+ :exc: `LookupError `) are left untouched and are copied as-is.
1502+
1503+ *errors* has the usual meaning for codecs. It may be ``NULL`` which indicates to
1504+ use the default error handling.
15011505
15021506
15031507.. c:function:: PyObject* PyUnicode_TranslateCharmap(const Py_UNICODE *s, Py_ssize_t size, \
@@ -1600,23 +1604,6 @@ They all return ``NULL`` or ``-1`` if an exception occurs.
16001604 characters are not included in the resulting strings.
16011605
16021606
1603- .. c :function :: PyObject* PyUnicode_Translate (PyObject *str, PyObject *table, \
1604- const char *errors)
1605-
1606- Translate a string by applying a character mapping table to it and return the
1607- resulting Unicode object.
1608-
1609- The mapping table must map Unicode ordinal integers to Unicode ordinal integers
1610- or ``None `` (causing deletion of the character).
1611-
1612- Mapping tables need only provide the :meth:`__getitem__` interface; dictionaries
1613- and sequences work well. Unmapped character ordinals (ones which cause a
1614- :exc: `LookupError `) are left untouched and are copied as-is.
1615-
1616- *errors* has the usual meaning for codecs. It may be ``NULL`` which indicates to
1617- use the default error handling.
1618-
1619-
16201607.. c :function :: PyObject* PyUnicode_Join (PyObject *separator, PyObject *seq)
16211608
16221609 Join a sequence of strings using the given *separator * and return the resulting
0 commit comments