Skip to content

Commit dbb98b0

Browse files
committed
Refresh for current main: regenerate at UCD 18, retarget to 3.16
Regenerate Objects/unicodetype_db.h at Unicode 18.0.0 with the White_Space property (25 whitespace code points; U+001C..U+001F no longer whitespace). Retarget the docs versionchanged and test notes from 3.9 to 3.16, rename the NEWS entry to the current gh-issue convention, and update the unicodedata method checksums for the intended behavior change. Co-authored-by: Muse Code (Meta Muse Spark)
1 parent f0dc74f commit dbb98b0

5 files changed

Lines changed: 1541 additions & 1545 deletions

File tree

‎Doc/builtins/stdtypes.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2572,7 +2572,7 @@ expression support in the :mod:`re` module).
25722572
The whitespace characters are `as defined by Unicode
25732573
<https://www.unicode.org/reports/tr44/#White_Space>`_.
25742574

2575-
.. versionchanged:: 3.9
2575+
.. versionchanged:: 3.16
25762576
Previously used a different definition of whitespace characters,
25772577
which included the additional characters ``\x1c``, ``\x1d``,
25782578
``\x1e``, and ``\x1f``.

‎Lib/test/test_str.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -760,13 +760,13 @@ def test_isspace(self):
760760

761761
@support.requires_resource('cpu')
762762
def test_isspace_invariant(self):
763-
'''
764-
Before Python 3.9, `str.isspace` used a certain formula
763+
"""
764+
Before Python 3.16, `str.isspace` used a certain formula
765765
combining the General Category and the Bidirectional Class.
766766
767-
Since Python 3.9, we use the White_Space property that Unicode
767+
Since Python 3.16, we use the White_Space property that Unicode
768768
now provides. Check that these differ only on U+001C..U+001F .
769-
'''
769+
"""
770770
for codepoint in range(sys.maxunicode + 1):
771771
char = chr(codepoint)
772772
bidirectional = unicodedata.bidirectional(char)
@@ -849,7 +849,7 @@ def test_isnumeric(self):
849849
self.assertTrue(ch.isnumeric(), '{!a} is numeric.'.format(ch))
850850

851851
def test_bytes_consistency(self):
852-
'''Check str and bytes agree on character properties within ASCII.'''
852+
"""Check str and bytes agree on character properties within ASCII."""
853853
for codepoint in range(0x80):
854854
char = chr(codepoint)
855855
byte = bytes([codepoint])

‎Lib/test/test_unicodedata.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def download_test_data_file(filename):
5555
class UnicodeMethodsTest(unittest.TestCase):
5656

5757
# update this, if the database changes
58-
expectedchecksum = ('2bb59305a65254fee9cd6ef981cc3cab7551c60e'
58+
expectedchecksum = ('a95371700ebbde3c78130d5e713bfdb6958dfb12'
5959
if quicktest else
60-
'bb69894a259aee5971445eca8e617a1686a432e2')
60+
'56aaa60dc1f94b8876d521937c5788aa3dd62cc3')
6161

6262
def test_method_checksum(self):
6363
h = hashlib.sha1()

Misc/NEWS.d/next/Core and Builtins/2019-08-07-21-30-13.bpo-18236.YtYsEp.rst renamed to Misc/NEWS.d/next/Core and Builtins/2026-10-22-22-30-47.gh-issue-62436.rxu3A4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
The definition of "whitespace" provided by :meth:`str.isspace` and
22
:c:func:`Py_UNICODE_ISSPACE` now follows Unicode's ``White_Space`` property.
33
This has the effect that the four characters ``\x1c``, ``\x1d``, ``\x1e``,
4-
``\x1f`` are no longer treated as whitespace. Patch by Greg Price.
4+
``\x1f`` are no longer treated as whitespace.

0 commit comments

Comments
 (0)