From: Adorilson Bezerra Date: Mon, 24 Nov 2025 14:10:35 +0000 (+0000) Subject: gh-106318: Add example for str.isalpha() (#137557) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0387a8e0f773c5f60c089b3801898eb34c49cacd;p=thirdparty%2FPython%2Fcpython.git gh-106318: Add example for str.isalpha() (#137557) Co-authored-by: Éric Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Victor Stinner --- 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 38de27a2b795..3f34245d8daf 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2057,6 +2057,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()