string.maketrans() now produces translation tables for bytes.translate() -- wrong module?
Fix all remaining instances that did bad things with the new str.translate().
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index dab3476..084c07c 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1549,10 +1549,10 @@
b'example'
-.. method:: bytes.translate(table[, deletechars])
+.. method:: bytes.translate(table[, delete])
Return a copy of the bytes object where all bytes occurring in the optional
- argument *deletechars* are removed, and the remaining bytes have been mapped
+ argument *delete* are removed, and the remaining bytes have been mapped
through the given translation table, which must be a bytes object of length
256.
@@ -1560,8 +1560,7 @@
create a translation table.
.. XXX a None table doesn't seem to be supported
- For string objects, set the *table* argument to
- ``None`` for translations that only delete characters::
+ Set the *table* argument to ``None`` for translations that only delete characters::
>>> 'read this short text'.translate(None, 'aeiou')
'rd ths shrt txt'
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 4d79749..2e1b529 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -128,10 +128,11 @@
.. method:: get_field(field_name, args, kwargs, used_args)
Given *field_name* as returned by :meth:`parse` (see above), convert it to
- an object to be formatted. The default version takes strings of the form
- defined in :pep:`3101`, such as "0[name]" or "label.title". It records
- which args have been used in *used_args*. *args* and *kwargs* are as
- passed in to :meth:`vformat`.
+ an object to be formatted. Returns a tuple (obj, used_key). The default
+ version takes strings of the form defined in :pep:`3101`, such as
+ "0[name]" or "label.title". *args* and *kwargs* are as passed in to
+ :meth:`vformat`. The return value *used_key* has the same meaning as the
+ *key* parameter to :meth:`get_value`.
.. method:: get_value(key, args, kwargs)
@@ -554,15 +555,8 @@
leading and trailing whitespace.
-.. XXX is obsolete with unicode.translate
-.. function:: maketrans(from, to)
+.. function:: maketrans(frm, to)
- Return a translation table suitable for passing to :func:`translate`, that will
- map each character in *from* into the character at the same position in *to*;
- *from* and *to* must have the same length.
-
- .. warning::
-
- Don't use strings derived from :const:`lowercase` and :const:`uppercase` as
- arguments; in some locales, these don't have the same length. For case
- conversions, always use :func:`lower` and :func:`upper`.
+ Return a translation table suitable for passing to :meth:`bytes.translate`,
+ that will map each character in *from* into the character at the same
+ position in *to*; *from* and *to* must have the same length.