diff options
author | Georg Brandl <georg@python.org> | 2006-12-07 09:30:06 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-12-07 09:30:06 +0000 |
commit | 70f466932cd1b0fdd734df61bbf9190848e51f3a (patch) | |
tree | a11ad4774f7caa714b61c37e6a2f3dee70ce17a2 | |
parent | 8211297a7e4d18833b61170f65a1c47183e348c8 (diff) | |
download | cpython-git-70f466932cd1b0fdd734df61bbf9190848e51f3a.tar.gz |
RFE #1592899: mention string.maketrans() in docs for str.translate,
remove reference to the old regex module in the former's doc.
-rw-r--r-- | Doc/lib/libstdtypes.tex | 3 | ||||
-rw-r--r-- | Doc/lib/libstring.tex | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex index ae3e49276b..0693f0d80f 100644 --- a/Doc/lib/libstdtypes.tex +++ b/Doc/lib/libstdtypes.tex @@ -876,6 +876,9 @@ optional argument \var{deletechars} are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256. +You can use the \function{maketrans()} helper function in the +\refmodule{string} module to create a translation table. + For Unicode objects, the \method{translate()} method does not accept the optional \var{deletechars} argument. Instead, it returns a copy of the \var{s} where all characters have been mapped diff --git a/Doc/lib/libstring.tex b/Doc/lib/libstring.tex index 1828b2e1cd..bc1649fdbf 100644 --- a/Doc/lib/libstring.tex +++ b/Doc/lib/libstring.tex @@ -220,7 +220,7 @@ objects. They are not available as string methods. \begin{funcdesc}{maketrans}{from, to} Return a translation table suitable for passing to - \function{translate()} or \function{regex.compile()}, that will map + \function{translate()}, that will map each character in \var{from} into the character at the same position in \var{to}; \var{from} and \var{to} must have the same length. |