cpython: 60b3a5615c4e (original) (raw)

Mercurial > cpython

changeset 70947:60b3a5615c4e 2.7

Issue #12164: Document (in docstring) that str.translate accepts None for the first argument. [#12164]

Mark Dickinson mdickinson@enthought.com
date Sat, 25 Jun 2011 11:00:12 +0200
parents c72dafb14c49
children 4970fa3c4a0b d912dfb7ab7a
files Objects/stringobject.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-)[+] [-] Objects/stringobject.c 4

line wrap: on

line diff

--- 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[](#l1.4) in the optional argument deletechars are removed, and the\n[](#l1.5) remaining characters have been mapped through the given\n[](#l1.6) -translation table, which must be a string of length 256."); +translation table, which must be a string of length 256 or None.\n[](#l1.8) +If the table argument is None, no translation is applied and\n[](#l1.9) +the operation simply removes the characters in deletechars."); static PyObject * string_translate(PyStringObject *self, PyObject *args)