From a676b2e00fa994b9da8684b62b1f32916ade71bd Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 24 Nov 2025 16:29:49 +0200 Subject: [PATCH] [3.13] gh-106318: Add example for str.isalpha() (GH-137557) (#141902) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Co-authored-by: Adorilson Bezerra Co-authored-by: Éric Co-authored-by: Victor Stinner --- Doc/howto/unicode.rst | 2 ++ Doc/library/stdtypes.rst | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst index 254fe7293553..243cc27bac70 100644 --- a/Doc/howto/unicode.rst +++ b/Doc/howto/unicode.rst @@ -352,6 +352,8 @@ If you don't include such a comment, the default encoding used will be UTF-8 as already mentioned. See also :pep:`263` for more information. +.. _unicode-properties: + Unicode Properties ------------------ diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index df431a83972b..b942118d67fb 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1921,6 +1921,18 @@ expression support in the :mod:`re` module). from the `Alphabetic property defined in the section 4.10 'Letters, Alphabetic, and Ideographic' of the Unicode Standard `_. + For example: + + .. doctest:: + + >>> 'Letters and spaces'.isalpha() + False + >>> 'LettersOnly'.isalpha() + True + >>> 'µ'.isalpha() # non-ASCII characters can be considered alphabetical too + True + + See :ref:`unicode-properties`. .. method:: str.isascii() -- 2.47.3