]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Update example of str.split, bytes.split (#121287)
authorYuxin Wu <ppwwyyxxc@gmail.com>
Fri, 5 Jul 2024 20:08:29 +0000 (13:08 -0700)
committerGitHub <noreply@github.com>
Fri, 5 Jul 2024 20:08:29 +0000 (13:08 -0700)
commit892e3a1b708391cb43517a141f9b9712e047b8a4
tree81cd4c0e3c60cb117bc29a56876a46e2b9d9715b
parent8ecb8962e33930dd56d72004a59336d4b00fce22
Update example of str.split, bytes.split (#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.

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