From: Walter Dörwald Date: Tue, 14 Sep 2004 09:40:45 +0000 (+0000) Subject: Enhance the docstrings for unicode.split() and string.split() X-Git-Tag: v2.4b1~266 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=782afc5927c5d37c3de1a082b6363a79e4bd5962;p=python Enhance the docstrings for unicode.split() and string.split() to make it clear that it is possible to pass None as the separator argument to get the default "any whitespace" separator. --- diff --git a/Lib/string.py b/Lib/string.py index e5afa9b22a..ce392be4e9 100644 --- a/Lib/string.py +++ b/Lib/string.py @@ -282,7 +282,7 @@ def split(s, sep=None, maxsplit=-1): Return a list of the words in the string s, using sep as the delimiter string. If maxsplit is given, splits at no more than maxsplit places (resulting in at most maxsplit+1 words). If sep - is not specified, any whitespace string is a separator. + is not specified or None, any whitespace string is a separator. (split and splitfields are synonymous) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 05fd11c55d..722b4274bb 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5987,8 +5987,8 @@ PyDoc_STRVAR(split__doc__, \n\ Return a list of the words in S, using sep as the\n\ delimiter string. If maxsplit is given, at most maxsplit\n\ -splits are done. If sep is not specified, any whitespace string\n\ -is a separator."); +splits are done. If sep is not specified or None, +any whitespace string is a separator."); static PyObject* unicode_split(PyUnicodeObject *self, PyObject *args)