]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-106318: Add example for str.isalpha() (GH-137557) (#141902)
authorHugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Mon, 24 Nov 2025 14:29:49 +0000 (16:29 +0200)
committerGitHub <noreply@github.com>
Mon, 24 Nov 2025 14:29:49 +0000 (14:29 +0000)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Doc/howto/unicode.rst
Doc/library/stdtypes.rst

index 254fe7293553535e1a963a7bb2825d39fc462067..243cc27bac7025dd2e8715c380dd57d51a95ecd2 100644 (file)
@@ -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
 ------------------
 
index df431a83972b7886bf654837e843654f8faba811..b942118d67fb9b1d9aeda81ae58b618eeeb88b49 100644 (file)
@@ -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
    <https://www.unicode.org/versions/Unicode15.1.0/ch04.pdf>`_.
+   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()