Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b6299e8

Browse filesBrowse files
miss-islingtontmlnedbatdonBarbos
authored
[3.14] gh-133986: Document string split algorithm when sep is None and maxsplit is 0 (GH-133987) (#133993)
--------- (cherry picked from commit 3e23047) Co-authored-by: Joey Smith <joeysmith@gmail.com> Co-authored-by: Ned Batchelder <ned@nedbatchelder.com> Co-authored-by: Semyon Moroz <donbarbos@proton.me>
1 parent 4adb1dd commit b6299e8
Copy full SHA for b6299e8

File tree

Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed

‎Doc/library/stdtypes.rst

Copy file name to clipboardExpand all lines: Doc/library/stdtypes.rst
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,6 +2269,18 @@ expression support in the :mod:`re` module).
22692269
>>> ' 1 2 3 '.split()
22702270
['1', '2', '3']
22712271

2272+
If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only
2273+
leading runs of consecutive whitespace are considered.
2274+
2275+
For example::
2276+
2277+
>>> "".split(None, 0)
2278+
[]
2279+
>>> " ".split(None, 0)
2280+
[]
2281+
>>> " foo ".split(maxsplit=0)
2282+
['foo ']
2283+
22722284

22732285
.. index::
22742286
single: universal newlines; str.splitlines method

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.