mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
gh-106318: Add example for str.isalpha() (#137557)
Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
a4f4225213
commit
0387a8e0f7
2 changed files with 14 additions and 0 deletions
|
|
@ -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
|
||||
------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
<https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-4/#G91002>`__.
|
||||
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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue