diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/stringlib/partition.h | 8 | ||||
-rw-r--r-- | Objects/stringobject.c | 4 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/Objects/stringlib/partition.h b/Objects/stringlib/partition.h index 14863475d4..105ba317d6 100644 --- a/Objects/stringlib/partition.h +++ b/Objects/stringlib/partition.h @@ -78,12 +78,12 @@ stringlib_rpartition( } if (pos < 0) { - Py_INCREF(str_obj); - PyTuple_SET_ITEM(out, 0, (PyObject*) str_obj); Py_INCREF(STRINGLIB_EMPTY); - PyTuple_SET_ITEM(out, 1, (PyObject*) STRINGLIB_EMPTY); + PyTuple_SET_ITEM(out, 0, (PyObject*) STRINGLIB_EMPTY); Py_INCREF(STRINGLIB_EMPTY); - PyTuple_SET_ITEM(out, 2, (PyObject*) STRINGLIB_EMPTY); + PyTuple_SET_ITEM(out, 1, (PyObject*) STRINGLIB_EMPTY); + Py_INCREF(str_obj); + PyTuple_SET_ITEM(out, 2, (PyObject*) str_obj); return out; } diff --git a/Objects/stringobject.c b/Objects/stringobject.c index f3ef4b8645..4c2faf4543 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -1543,11 +1543,11 @@ string_partition(PyStringObject *self, PyObject *sep_obj) } PyDoc_STRVAR(rpartition__doc__, -"S.rpartition(sep) -> (head, sep, tail)\n\ +"S.rpartition(sep) -> (tail, sep, head)\n\ \n\ Searches for the separator sep in S, starting at the end of S, and returns\n\ the part before it, the separator itself, and the part after it. If the\n\ -separator is not found, returns S and two empty strings."); +separator is not found, returns two empty strings and S."); static PyObject * string_rpartition(PyStringObject *self, PyObject *sep_obj) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 20daf6682b..7937281152 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -6712,11 +6712,11 @@ unicode_partition(PyUnicodeObject *self, PyObject *separator) } PyDoc_STRVAR(rpartition__doc__, -"S.rpartition(sep) -> (head, sep, tail)\n\ +"S.rpartition(sep) -> (tail, sep, head)\n\ \n\ Searches for the separator sep in S, starting at the end of S, and returns\n\ the part before it, the separator itself, and the part after it. If the\n\ -separator is not found, returns S and two empty strings."); +separator is not found, returns two empty strings and S."); static PyObject* unicode_rpartition(PyUnicodeObject *self, PyObject *separator) |