Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb83ffe

Browse files
committed
fix error in split() examples (closes #22459)
Patch by Raúl Cumplido.
1 parent 61ff32f commit eb83ffe

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Doc/library/stdtypes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ expression support in the :mod:`re` module).
18301830
>>> '1,2,3'.split(',')
18311831
['1', '2', '3']
18321832
>>> '1,2,3'.split(',', maxsplit=1)
1833-
['1', '2 3']
1833+
['1', '2,3']
18341834
>>> '1,2,,3,'.split(',')
18351835
['1', '2', '', '3', '']
18361836

@@ -2695,7 +2695,7 @@ produce new objects.
26952695
>>> b'1,2,3'.split(b',')
26962696
[b'1', b'2', b'3']
26972697
>>> b'1,2,3'.split(b',', maxsplit=1)
2698-
[b'1', b'2 3']
2698+
[b'1', b'2,3']
26992699
>>> b'1,2,,3,'.split(b',')
27002700
[b'1', b'2', b'', b'3', b'']
27012701

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ Drew Csillag
296296
Joaquin Cuenca Abela
297297
John Cugini
298298
Tom Culliton
299+
Raúl Cumplido
299300
Antonio Cuni
300301
Brian Curtin
301302
Lisandro Dalcin

0 commit comments

Comments
 (0)