[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 3c9c3d33cb)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
This commit is contained in:
Miss Islington (bot) 2026-01-19 15:22:24 +01:00 committed by GitHub
parent 48a8cd1d12
commit 4ada03f47f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)