diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-10-28 23:11:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-28 23:11:54 (GMT) |
commit | a2314283ff87c65e1745a42c2f2b716b1a209128 (patch) | |
tree | b1b1287aeea750c8694673939ec72b469c19cc59 /Doc/library | |
parent | 5a4bbcd479ce86f68bbe12bc8c16e3447f32e13a (diff) | |
download | cpython-a2314283ff87c65e1745a42c2f2b716b1a209128.zip cpython-a2314283ff87c65e1745a42c2f2b716b1a209128.tar.gz cpython-a2314283ff87c65e1745a42c2f2b716b1a209128.tar.bz2 |
bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)
separators that are not bytes-like objects.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/stdtypes.rst | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 2fce851..0bcafd3 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2573,8 +2573,9 @@ arbitrary binary data. bytearray.partition(sep) Split the sequence at the first occurrence of *sep*, and return a 3-tuple - containing the part before the separator, the separator, and the part - after the separator. If the separator is not found, return a 3-tuple + containing the part before the separator, the separator itself or its + bytearray copy, and the part after the separator. + If the separator is not found, return a 3-tuple containing a copy of the original sequence, followed by two empty bytes or bytearray objects. @@ -2629,8 +2630,9 @@ arbitrary binary data. bytearray.rpartition(sep) Split the sequence at the last occurrence of *sep*, and return a 3-tuple - containing the part before the separator, the separator, and the part - after the separator. If the separator is not found, return a 3-tuple + containing the part before the separator, the separator itself or its + bytearray copy, and the part after the separator. + If the separator is not found, return a 3-tuple containing a copy of the original sequence, followed by two empty bytes or bytearray objects. |