@@ -2180,7 +2180,18 @@ expression support in the :mod:`re` module).
21802180 Return ``True `` if all characters in the string are alphanumeric and there is at
21812181 least one character, ``False `` otherwise. A character ``c `` is alphanumeric if one
21822182 of the following returns ``True ``: ``c.isalpha() ``, ``c.isdecimal() ``,
2183- ``c.isdigit() ``, or ``c.isnumeric() ``.
2183+ ``c.isdigit() ``, or ``c.isnumeric() ``. For example::
2184+
2185+ .. doctest ::
2186+
2187+ >>> ' abc123' .isalnum()
2188+ True
2189+ >>> ' abc123!@#' .isalnum()
2190+ False
2191+ >>> ' ' .isalnum()
2192+ False
2193+ >>> ' ' .isalnum()
2194+ False
21842195
21852196
21862197.. method :: str.isalpha()
@@ -2472,6 +2483,19 @@ expression support in the :mod:`re` module).
24722483 after the separator. If the separator is not found, return a 3-tuple containing
24732484 the string itself, followed by two empty strings.
24742485
2486+ For example:
2487+
2488+ .. doctest ::
2489+
2490+ >>> ' Monty Python' .partition(' ' )
2491+ ('Monty', ' ', 'Python')
2492+ >>> " Monty Python's Flying Circus" .partition(' ' )
2493+ ('Monty', ' ', "Python's Flying Circus")
2494+ >>> ' Monty Python' .partition(' -' )
2495+ ('Monty Python', '', '')
2496+
2497+ See also :meth: `rpartition `.
2498+
24752499
24762500.. method :: str.removeprefix(prefix, /)
24772501
0 commit comments