Skip to content

gh-124016: update Unicode to 16.0.0 #124017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,7 @@ expression support in the :mod:`re` module).

The casefolding algorithm is
`described in section 3.13 'Default Case Folding' of the Unicode Standard
<https://www.unicode.org/versions/Unicode15.1.0/ch03.pdf>`__.
<https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-3/#G33992>`__.

.. versionadded:: 3.3

Expand Down Expand Up @@ -1843,7 +1843,7 @@ expression support in the :mod:`re` module).
property being one of "Lm", "Lt", "Lu", "Ll", or "Lo". Note that this is different
from the `Alphabetic property defined in the section 4.10 'Letters, Alphabetic, and
Ideographic' of the Unicode Standard
<https://www.unicode.org/versions/Unicode15.1.0/ch04.pdf>`_.
<https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-4/#G91002>`_.


.. method:: str.isascii()
Expand Down Expand Up @@ -1979,7 +1979,7 @@ expression support in the :mod:`re` module).

The lowercasing algorithm used is
`described in section 3.13 'Default Case Folding' of the Unicode Standard
<https://www.unicode.org/versions/Unicode15.1.0/ch03.pdf>`__.
<https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-3/#G33992>`__.


.. method:: str.lstrip([chars])
Expand Down Expand Up @@ -2331,7 +2331,7 @@ expression support in the :mod:`re` module).

The uppercasing algorithm used is
`described in section 3.13 'Default Case Folding' of the Unicode Standard
<https://www.unicode.org/versions/Unicode15.1.0/ch03.pdf>`__.
<https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-3/#G33992>`__.


.. method:: str.zfill(width)
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/unicodedata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

This module provides access to the Unicode Character Database (UCD) which
defines character properties for all Unicode characters. The data contained in
this database is compiled from the `UCD version 15.1.0
<https://www.unicode.org/Public/15.1.0/ucd>`_.
this database is compiled from the `UCD version 16.0.0
<https://www.unicode.org/Public/16.0.0/ucd>`_.

The module uses the same names and symbols as defined by Unicode
Standard Annex #44, `"Unicode Character Database"
Expand Down Expand Up @@ -175,6 +175,6 @@ Examples:

.. rubric:: Footnotes

.. [#] https://www.unicode.org/Public/15.1.0/ucd/NameAliases.txt
.. [#] https://www.unicode.org/Public/16.0.0/ucd/NameAliases.txt

.. [#] https://www.unicode.org/Public/15.1.0/ucd/NamedSequences.txt
.. [#] https://www.unicode.org/Public/16.0.0/ucd/NamedSequences.txt
8 changes: 4 additions & 4 deletions Doc/reference/lexical_analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,16 @@ The Unicode category codes mentioned above stand for:
* *Nd* - decimal numbers
* *Pc* - connector punctuations
* *Other_ID_Start* - explicit list of characters in `PropList.txt
<https://www.unicode.org/Public/15.1.0/ucd/PropList.txt>`_ to support backwards
<https://www.unicode.org/Public/16.0.0/ucd/PropList.txt>`_ to support backwards
compatibility
* *Other_ID_Continue* - likewise

All identifiers are converted into the normal form NFKC while parsing; comparison
of identifiers is based on NFKC.

A non-normative HTML file listing all valid identifier characters for Unicode
15.1.0 can be found at
https://www.unicode.org/Public/15.1.0/ucd/DerivedCoreProperties.txt
16.0.0 can be found at
https://www.unicode.org/Public/16.0.0/ucd/DerivedCoreProperties.txt


.. _keywords:
Expand Down Expand Up @@ -1044,4 +1044,4 @@ occurrence outside string literals and comments is an unconditional error:

.. rubric:: Footnotes

.. [#] https://www.unicode.org/Public/15.1.0/ucd/NameAliases.txt
.. [#] https://www.unicode.org/Public/16.0.0/ucd/NameAliases.txt
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ symtable

(Contributed by Bénédikt Tran in :gh:`120029`.)

unicodedata
-----------

* The Unicode database has been updated to Unicode 16.0.0.

.. Add improved modules above alphabetically, not here at the end.

Optimizations
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/string_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,8 +1132,8 @@ def test_capitalize_nonascii(self):
self.checkequal('\u2160\u2171\u2172',
'\u2170\u2171\u2172', 'capitalize')
# check with Ll chars with no upper - nothing changes here
self.checkequal('\u019b\u1d00\u1d86\u0221\u1fb7',
'\u019b\u1d00\u1d86\u0221\u1fb7', 'capitalize')
self.checkequal('\u1d00\u1d86\u0221\u1fb7',
'\u1d00\u1d86\u0221\u1fb7', 'capitalize')

def test_startswith(self):
self.checkequal(True, 'hello', 'startswith', 'he')
Expand Down
6 changes: 4 additions & 2 deletions Lib/test/test_str.py
Original file line number Diff line number Diff line change
Expand Up @@ -2430,8 +2430,10 @@ def __repr__(self):
self.assertEqual(repr(s1()), '\\n')

def test_printable_repr(self):
self.assertEqual(repr('\U00010000'), "'%c'" % (0x10000,)) # printable
self.assertEqual(repr('\U00014000'), "'\\U00014000'") # nonprintable
# printable
self.assertEqual(repr('\U00010000'), "'%c'" % (0x10000,))
# nonprintable (private use area)
self.assertEqual(repr('\U00100001'), "'\\U00100001'")

# This test only affects 32-bit platforms because expandtabs can only take
# an int as the max value, not a 64-bit C long. If expandtabs is changed
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_unicodedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class UnicodeMethodsTest(unittest.TestCase):

# update this, if the database changes
expectedchecksum = '63aa77dcb36b0e1df082ee2a6071caeda7f0955e'
expectedchecksum = '9e43ee3929471739680c0e705482b4ae1c4122e4'

@requires_resource('cpu')
def test_method_checksum(self):
Expand Down Expand Up @@ -71,7 +71,7 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):

# Update this if the database changes. Make sure to do a full rebuild
# (e.g. 'make distclean && make') to get the correct checksum.
expectedchecksum = '232affd2a50ec4bd69d2482aa0291385cbdefaba'
expectedchecksum = '23ab09ed4abdf93db23b97359108ed630dd8311d'

@requires_resource('cpu')
def test_function_checksum(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update :mod:`unicodedata` database to Unicode 16.0.0.
Loading
Loading