Skip to content

Commit b7aae18

Browse files
adorilsonStanFromIrelandhugovk
authored andcommitted
gh-106318: Add example for str.isascii() (GH-137558)
(cherry picked from commit 0afcb51) Co-authored-by: Adorilson Bezerra <adorilson@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 2701e8e commit b7aae18

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Doc/library/stdtypes.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,14 @@ expression support in the :mod:`re` module).
19271927

19281928
Return ``True`` if the string is empty or all characters in the string are ASCII,
19291929
``False`` otherwise.
1930-
ASCII characters have code points in the range U+0000-U+007F.
1930+
ASCII characters have code points in the range U+0000-U+007F. For example:
1931+
1932+
.. doctest::
1933+
1934+
>>> 'ASCII characters'.isascii()
1935+
True
1936+
>>> 'µ'.isascii()
1937+
False
19311938

19321939
.. versionadded:: 3.7
19331940

0 commit comments

Comments
 (0)