mirror of
https://github.com/python/cpython.git
synced 2025-08-27 20:25:18 +00:00
bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)
separators that are not bytes-like objects.
This commit is contained in:
parent
5a4bbcd479
commit
a2314283ff
9 changed files with 89 additions and 38 deletions
|
@ -13067,7 +13067,7 @@ str.rpartition as unicode_rpartition = str.partition
|
|||
|
||||
Partition the string into three parts using the given separator.
|
||||
|
||||
This will search for the separator in the string, starting and the end. If
|
||||
This will search for the separator in the string, starting at the end. If
|
||||
the separator is found, returns a 3-tuple containing the part before the
|
||||
separator, the separator itself, and the part after it.
|
||||
|
||||
|
@ -13077,7 +13077,7 @@ and the original string.
|
|||
|
||||
static PyObject *
|
||||
unicode_rpartition(PyObject *self, PyObject *sep)
|
||||
/*[clinic end generated code: output=1aa13cf1156572aa input=e77c7acb69bdfca6]*/
|
||||
/*[clinic end generated code: output=1aa13cf1156572aa input=c4b7db3ef5cf336a]*/
|
||||
{
|
||||
return PyUnicode_RPartition(self, sep);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue