]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106318: Add example for str.isascii() (#137558)
authorAdorilson Bezerra <adorilson@gmail.com>
Mon, 24 Nov 2025 14:02:18 +0000 (14:02 +0000)
committerGitHub <noreply@github.com>
Mon, 24 Nov 2025 14:02:18 +0000 (16:02 +0200)
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 7eb4f743d5abab332e2a495608484a5a0b3bc19b..38de27a2b7954925be7c5d6ae0fea0042ee67fdf 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