summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
authorMark Dickinson <mdickinson@enthought.com>2011-06-25 09:00:12 (GMT)
committerMark Dickinson <mdickinson@enthought.com>2011-06-25 09:00:12 (GMT)
commitcb9bf1ac9c420249f9598931c777b9df83a8d22d (patch)
tree3e4e1fd5a60ca1e28ba24ce46a65d19bed95a734 /Objects/stringobject.c
parentffa8e2fb5637db784478e0f1f3c0d260dbae972e (diff)
downloadcpython-cb9bf1ac9c420249f9598931c777b9df83a8d22d.zip
cpython-cb9bf1ac9c420249f9598931c777b9df83a8d22d.tar.gz
cpython-cb9bf1ac9c420249f9598931c777b9df83a8d22d.tar.bz2
Issue #12164: Document (in docstring) that str.translate accepts None for the first argument.
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 693f773..b3b79b8 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -2173,7 +2173,9 @@ PyDoc_STRVAR(translate__doc__,
Return a copy of the string S, where all characters occurring\n\
in the optional argument deletechars are removed, and the\n\
remaining characters have been mapped through the given\n\
-translation table, which must be a string of length 256.");
+translation table, which must be a string of length 256 or None.\n\
+If the table argument is None, no translation is applied and\n\
+the operation simply removes the characters in deletechars.");
static PyObject *
string_translate(PyStringObject *self, PyObject *args)