pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/526d0a9b6eafb95c425838715a4961d97dc600da

97560d244c08.css" /> gh-110383: Improve accuracy of str.split() and str.rsplit() docstring… · python/cpython@526d0a9 · GitHub
Skip to content

Commit 526d0a9

Browse files
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.
1 parent ca8b1d0 commit 526d0a9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Objects/clinic/unicodeobject.c.h

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Objects/unicodeobject.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12504,11 +12504,13 @@ str.split as unicode_split
1250412504
character (including \n \r \t \f and spaces) and will discard
1250512505
empty strings from the result.
1250612506
maxsplit: Py_ssize_t = -1
12507-
Maximum number of splits (starting from the left).
12507+
Maximum number of splits.
1250812508
-1 (the default value) means no limit.
1250912509
1251012510
Return a list of the substrings in the string, using sep as the separator string.
1251112511
12512+
Splitting starts at the front of the string and works to the end.
12513+
1251212514
Note, str.split() is mainly useful for data that has been intentionally
1251312515
delimited. With natural text that includes punctuation, consider using
1251412516
the regular expression module.
@@ -12517,7 +12519,7 @@ the regular expression module.
1251712519

1251812520
static PyObject *
1251912521
unicode_split_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit)
12520-
/*[clinic end generated code: output=3a65b1db356948dc input=07b9040d98c5fe8d]*/
12522+
/*[clinic end generated code: output=3a65b1db356948dc input=a29bcc0c7a5af0eb]*/
1252112523
{
1252212524
if (sep == Py_None)
1252312525
return split(self, NULL, maxsplit);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy