From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 24 Nov 2025 14:08:14 +0000 (+0100) Subject: [3.13] gh-106318: Add example for str.isascii() (GH-137558) (#141899) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2188c7e5e0609a59ccb18c25fa8f61b1047f92d;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-106318: Add example for str.isascii() (GH-137558) (#141899) Co-authored-by: Adorilson Bezerra Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 0cbc5a9cb270..df431a83972b 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1927,7 +1927,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