]> granicus.if.org Git - python/commitdiff
Enhance the docstrings for unicode.split() and string.split()
authorWalter Dörwald <walter@livinglogic.de>
Tue, 14 Sep 2004 09:40:45 +0000 (09:40 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Tue, 14 Sep 2004 09:40:45 +0000 (09:40 +0000)
to make it clear that it is possible to pass None as the
separator argument to get the default "any whitespace" separator.

Lib/string.py
Objects/unicodeobject.c

index e5afa9b22ac64e0c4d774b662d7f91f32169d77e..ce392be4e97dcd24e8d55b0c0e4cbfa1380c9ecb 100644 (file)
@@ -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)
 
index 05fd11c55ded89368ef32aff4a7591a1a57d0fcb..722b4274bb23a25a5b395dc0d8e7bfe96d371c10 100644 (file)
@@ -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)