From 33535e0328f9e856664ee640819084bbfb62ec2e Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Wed, 11 Feb 2026 18:41:41 +0000 Subject: [PATCH 1/4] gh-106318: Add examples for str.isdigit() method docs --- Doc/library/stdtypes.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 0e5f5dc39e7277..a5792d57bf67cb 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2264,6 +2264,22 @@ expression support in the :mod:`re` module). like the Kharosthi numbers. Formally, a digit is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal. + For example: + + .. doctest:: + + >>> '0123456789'.isdigit() + True + >>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # Arabic-indic digits zero to nine + True + >>> '⅕'.isdigit() # Vulgar fraction one fifth + False + >>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric() + (False, True, True) + + See also :meth:`isdecimal` and :meth:`isnumeric`. Digital characters are a + superset of decimal characters. + .. method:: str.isidentifier() From 60cbdd95dfaa76be7df336fbcaaf2341d3cbfe49 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Wed, 11 Feb 2026 18:42:41 +0000 Subject: [PATCH 2/4] gh-106318: Fix typo in the str.isnumeric() method docs --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index a5792d57bf67cb..6ab15b246922d3 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2320,7 +2320,7 @@ expression support in the :mod:`re` module). >>> '0123456789'.isnumeric() True - >>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-indic digit zero to nine + >>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-indic digits zero to nine True >>> '⅕'.isnumeric() # Vulgar fraction one fifth True From 2b20c17c152a1647e3cc9fb0ba7b740e38ccf30a Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Wed, 11 Feb 2026 19:06:17 +0000 Subject: [PATCH 3/4] gh-106318: Add link to Kharosthi numbers on Wikipedia (str.isdigit() method docs) --- Doc/library/stdtypes.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 6ab15b246922d3..a8c983d729ff46 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2261,7 +2261,8 @@ expression support in the :mod:`re` module). character, ``False`` otherwise. Digits include decimal characters and digits that need special handling, such as the compatibility superscript digits. This covers digits which cannot be used to form numbers in base 10, - like the Kharosthi numbers. Formally, a digit is a character that has the + like the `Kharosthi numbers `__. + Formally, a digit is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal. For example: From 54d5482ea5bff8a254e323781edcce1ed22e7f2e Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Thu, 12 Feb 2026 09:49:19 +0000 Subject: [PATCH 4/4] gh-106318: Fix typo in the str.isdigit() docs --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index a8c983d729ff46..5a99a930e3ecb8 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2278,7 +2278,7 @@ expression support in the :mod:`re` module). >>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric() (False, True, True) - See also :meth:`isdecimal` and :meth:`isnumeric`. Digital characters are a + See also :meth:`isdecimal` and :meth:`isnumeric`. Digit characters are a superset of decimal characters.