-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
gh-106318: Add example for str.isalpha() #137557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
85664f3
9907d9b
ac028d7
3b53406
38c3493
c8645e9
55d4ea2
84f1a6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1990,7 +1990,19 @@ 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/Unicode16.0.0/core-spec/chapter-4/#G91002>`_. | ||
For example:: | ||
|
||
..doctest:: | ||
|
||
>>> 'a commom word'.isalpha() | ||
False | ||
>>> 'acommomword'.isalpha() | ||
True | ||
>>> 'µ'.isalpha() # no-ascii characters could be alpha too | ||
adorilson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
True | ||
|
||
|
||
See Unicode Properties section in :ref:`unicode-howto`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which section exactly are you referring to? The description already covers the properties. Idea: It could be shown in the example, e.g.: >>> import unicodedata
... unicodedata.category('é')
'Ll' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
https://docs.python.org/3/howto/unicode.html#unicode-properties I couldn't link to the subsection. Now I discovered that So, now I intend to put (adding this label on the Unicode Properties section) See :ref:`unicode-properties` I think this is more valuable than the example you suggested and a good complement to the description. Shall I go ahead with this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is done. Here and on #137592. |
||
|
||
.. method:: str.isascii() | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These conflict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the missing space after
..
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can’t have both
::
and the doctest. Look at what happens when you build it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got. Fixing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.