mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-110383: Improve accuracy of str.split() and str.rsplit() docstrings (#113355)
Clarify split direction in the docstring body, instead of in the 'maxsplit' param docstring.
This commit is contained in:
parent
ca8b1d0958
commit
526d0a9b6e
2 changed files with 9 additions and 5 deletions
8
Objects/clinic/unicodeobject.c.h
generated
8
Objects/clinic/unicodeobject.c.h
generated
|
@ -954,9 +954,11 @@ PyDoc_STRVAR(unicode_split__doc__,
|
|||
" character (including \\n \\r \\t \\f and spaces) and will discard\n"
|
||||
" empty strings from the result.\n"
|
||||
" maxsplit\n"
|
||||
" Maximum number of splits (starting from the left).\n"
|
||||
" Maximum number of splits.\n"
|
||||
" -1 (the default value) means no limit.\n"
|
||||
"\n"
|
||||
"Splitting starts at the front of the string and works to the end.\n"
|
||||
"\n"
|
||||
"Note, str.split() is mainly useful for data that has been intentionally\n"
|
||||
"delimited. With natural text that includes punctuation, consider using\n"
|
||||
"the regular expression module.");
|
||||
|
@ -1078,7 +1080,7 @@ PyDoc_STRVAR(unicode_rsplit__doc__,
|
|||
" character (including \\n \\r \\t \\f and spaces) and will discard\n"
|
||||
" empty strings from the result.\n"
|
||||
" maxsplit\n"
|
||||
" Maximum number of splits (starting from the left).\n"
|
||||
" Maximum number of splits.\n"
|
||||
" -1 (the default value) means no limit.\n"
|
||||
"\n"
|
||||
"Splitting starts at the end of the string and works to the front.");
|
||||
|
@ -1505,4 +1507,4 @@ skip_optional_pos:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=873d8b3d09af3095 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=1aab29bab5201c78 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue