changeset: 70947:60b3a5615c4e branch: 2.7 parent: 70944:c72dafb14c49 user: Mark Dickinson date: Sat Jun 25 11:00:12 2011 +0200 files: Objects/stringobject.c description: Issue #12164: Document (in docstring) that str.translate accepts None for the first argument. diff -r c72dafb14c49 -r 60b3a5615c4e Objects/stringobject.c --- a/Objects/stringobject.c Sat Jun 25 09:55:10 2011 +0200 +++ b/Objects/stringobject.c Sat Jun 25 11:00:12 2011 +0200 @@ -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)

AltStyle によって変換されたページ (->オリジナル) /