Skip to content

Commit c367466

Browse files
adorilsonmerwokhugovkvstinner
committed
[3.13] pythongh-106318: Add example for str.isalpha() (pythonGH-137557)
(cherry picked from commit 0387a8e) Co-authored-by: Adorilson Bezerra <[email protected]> Co-authored-by: Éric <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
1 parent e2188c7 commit c367466

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Doc/howto/unicode.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ If you don't include such a comment, the default encoding used will be UTF-8 as
352352
already mentioned. See also :pep:`263` for more information.
353353

354354

355+
.. _unicode-properties:
356+
355357
Unicode Properties
356358
------------------
357359

Doc/library/stdtypes.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,18 @@ expression support in the :mod:`re` module).
19211921
from the `Alphabetic property defined in the section 4.10 'Letters, Alphabetic, and
19221922
Ideographic' of the Unicode Standard
19231923
<https://www.unicode.org/versions/Unicode15.1.0/ch04.pdf>`_.
1924+
For example:
1925+
1926+
.. doctest::
1927+
1928+
>>> 'Letters and spaces'.isalpha()
1929+
False
1930+
>>> 'LettersOnly'.isalpha()
1931+
True
1932+
>>> 'µ'.isalpha() # non-ASCII characters can be considered alphabetical too
1933+
True
1934+
1935+
See :ref:`unicode-properties`.
19241936

19251937

19261938
.. method:: str.isascii()

0 commit comments

Comments
 (0)