]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] Update example of str.split, bytes.split (GH-121287) (#121415)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 5 Jul 2024 20:25:35 +0000 (22:25 +0200)
committerGitHub <noreply@github.com>
Fri, 5 Jul 2024 20:25:35 +0000 (20:25 +0000)
commitbc4cd91aef6a860ef911788caef5d11834c7cd2f
tree658bfce9afa5d3ecc74503d10b4ca209d79ea0c4
parent3c3f9a209f302599fdd1b6f3f6315028e1b4fcda
[3.13] Update example of str.split, bytes.split (GH-121287) (#121415)

Update example of str.split, bytes.split (GH-121287)

In `{str,bytes}.strip(chars)`, multiple characters are not treated as a
prefix/suffix, but as individual characters. This may make users confuse
whether `split` has similar behavior.
Users may incorrectly expect that
`'Good morning, John.'.split(', .') == ['Good', 'morning', 'John']`

Adding a bit of clarification in the doc.

(cherry picked from commit 892e3a1b708391cb43517a141f9b9712e047b8a4)

Co-authored-by: Yuxin Wu <ppwwyyxxc@gmail.com>
Co-authored-by: Yuxin Wu <ppwwyyxx@users.noreply.github.com>
Doc/library/stdtypes.rst