]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] Update example of str.split, bytes.split (GH-121287) (#121416)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 5 Jul 2024 20:23:00 +0000 (22:23 +0200)
committerGitHub <noreply@github.com>
Fri, 5 Jul 2024 20:23:00 +0000 (13:23 -0700)
commite7cea781bdcb601f7ac4d051edea82079fcc5a1f
tree92a41d9289509a36b3e5c1243b70a36961a9f25e
parent9e542f9a46a06247eafb5bc651fa06f3aaaad5eb
[3.12] Update example of str.split, bytes.split (GH-121287) (#121416)

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