]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-106318: Add example for str.isascii() (GH-137558) (#141898)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 24 Nov 2025 14:07:58 +0000 (15:07 +0100)
committerGitHub <noreply@github.com>
Mon, 24 Nov 2025 14:07:58 +0000 (14:07 +0000)
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>
Doc/library/stdtypes.rst

index 87dcf8fe977347206815014eefdfa3c6b81ead4b..9b1c6a3a744fdcce098252dc8382006b13649f43 100644 (file)
@@ -2063,7 +2063,14 @@ expression support in the :mod:`re` module).
 
    Return ``True`` if the string is empty or all characters in the string are ASCII,
    ``False`` otherwise.
-   ASCII characters have code points in the range U+0000-U+007F.
+   ASCII characters have code points in the range U+0000-U+007F. For example:
+
+   .. doctest::
+
+      >>> 'ASCII characters'.isascii()
+      True
+      >>> 'ยต'.isascii()
+      False
 
    .. versionadded:: 3.7