Skip to content

Commit a47ed2e

Browse files
miss-islingtonadorilsonStanFromIrelandhugovk
authored
[3.14] gh-106318: Add example for str.isascii() (GH-137558) (#141898)
Co-authored-by: Adorilson Bezerra <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 17c5d6d commit a47ed2e

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
@@ -2063,7 +2063,14 @@ expression support in the :mod:`re` module).
20632063

20642064
Return ``True`` if the string is empty or all characters in the string are ASCII,
20652065
``False`` otherwise.
2066-
ASCII characters have code points in the range U+0000-U+007F.
2066+
ASCII characters have code points in the range U+0000-U+007F. For example:
2067+
2068+
.. doctest::
2069+
2070+
>>> 'ASCII characters'.isascii()
2071+
True
2072+
>>> 'µ'.isascii()
2073+
False
20672074

20682075
.. versionadded:: 3.7
20692076

0 commit comments

Comments
 (0)