From: Adorilson Bezerra Date: Mon, 24 Nov 2025 14:02:18 +0000 (+0000) Subject: gh-106318: Add example for str.isascii() (#137558) X-Git-Tag: v3.15.0a3~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0afcb51d17489aee2aa02609ef6f2606a7c5bf26;p=thirdparty%2FPython%2Fcpython.git gh-106318: Add example for str.isascii() (#137558) 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 7eb4f743d5ab..38de27a2b795 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -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