[Python-checkins] cpython (2.7): Issue #12164: Document (in docstring) that str.translate accepts None for the

mark.dickinson python-checkins at python.org
Sat Jun 25 11:00:19 CEST 2011


http://hg.python.org/cpython/rev/60b3a5615c4e
changeset:   70947:60b3a5615c4e
branch:      2.7
parent:      70944:c72dafb14c49
user:        Mark Dickinson <mdickinson at enthought.com>
date:        Sat Jun 25 11:00:12 2011 +0200
summary:
  Issue #12164: Document (in docstring) that str.translate accepts None for the first argument.

files:
  Objects/stringobject.c |  4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Objects/stringobject.c b/Objects/stringobject.c
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -2173,7 +2173,9 @@
 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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list