https://github.com/python/cpython/commit/4ada03f47ff3216aa2cfb15ae6a90fa25c7ffb0d commit: 4ada03f47ff3216aa2cfb15ae6a90fa25c7ffb0d branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: vstinner <[email protected]> date: 2026-01-19T14:22:24Z summary:
[3.13] gh-106318: Add examples for str.rpartition() method (GH-143891) (#144041) gh-106318: Add examples for str.rpartition() method (GH-143891) (cherry picked from commit 3c9c3d33cbdef257526871cbc12e93635026f5d6) Co-authored-by: Adorilson Bezerra <[email protected]> files: M Doc/library/stdtypes.rst diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 34e27f72d6ff5c..ca7313ef73308f 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2321,6 +2321,19 @@ expression support in the :mod:`re` module). after the separator. If the separator is not found, return a 3-tuple containing two empty strings, followed by the string itself. + For example: + + .. doctest:: + + >>> 'Monty Python'.rpartition(' ') + ('Monty', ' ', 'Python') + >>> "Monty Python's Flying Circus".rpartition(' ') + ("Monty Python's Flying", ' ', 'Circus') + >>> 'Monty Python'.rpartition('-') + ('', '', 'Monty Python') + + See also :meth:`partition`. + .. method:: str.rsplit(sep=None, maxsplit=-1) _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
