Skip to content

Commit 96e0119

Browse files
authored
Merge branch 'main' into unignore-error-port-unreachable-in-proactor
2 parents b6eb862 + 659e262 commit 96e0119

121 files changed

Lines changed: 26381 additions & 25957 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Doc/builtins/stdtypes.rst‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,7 +2157,7 @@ expression support in the :mod:`re` module).
21572157

21582158
The casefolding algorithm is `described in section 3.13.3 'Default Case
21592159
Folding' of the Unicode Standard
2160-
<https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G53253>`__.
2160+
<https://www.unicode.org/versions/Unicode18.0.0/core-spec/chapter-3/#G53253>`__.
21612161

21622162
.. versionadded:: 3.3
21632163

@@ -2398,7 +2398,7 @@ expression support in the :mod:`re` module).
23982398
property being one of "Lm", "Lt", "Lu", "Ll", or "Lo". Note that this is different
23992399
from the `Alphabetic property defined in section 4.10 'Letters, Alphabetic, and
24002400
Ideographic' of the Unicode Standard
2401-
<https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-4/#G91002>`__.
2401+
<https://www.unicode.org/versions/Unicode18.0.0/core-spec/chapter-4/#G91002>`__.
24022402
For example:
24032403

24042404
.. doctest::
@@ -2664,7 +2664,7 @@ expression support in the :mod:`re` module).
26642664

26652665
The lowercasing algorithm used is `described in section 3.13.2 'Default Case
26662666
Conversion' of the Unicode Standard
2667-
<https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G34078>`__.
2667+
<https://www.unicode.org/versions/Unicode18.0.0/core-spec/chapter-3/#G34078>`__.
26682668

26692669

26702670
.. method:: str.lstrip(chars=None, /)
@@ -3176,7 +3176,7 @@ expression support in the :mod:`re` module).
31763176

31773177
The uppercasing algorithm used is `described in section 3.13.2 'Default Case
31783178
Conversion' of the Unicode Standard
3179-
<https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G34078>`__.
3179+
<https://www.unicode.org/versions/Unicode18.0.0/core-spec/chapter-3/#G34078>`__.
31803180

31813181

31823182
.. method:: str.zfill(width, /)

‎Doc/c-api/bytes.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ called with a non-bytes parameter.
249249
250250
While bytes objects are usually immutable in Python, this special C API
251251
allows mutating a bytes object in-place. The returned bytes object can still
252-
be mutated using :c:func:`PyBytesWriter_GetData`; except if *newsize* is
252+
be mutated using :c:func:`PyBytes_AsString`; except if *newsize* is
253253
zero in which case it returns the immutable empty bytes string.
254254
255255
.. soft-deprecated:: 3.15
@@ -305,8 +305,8 @@ object.
305305
306306
A bytes writer object.
307307
308-
The API is **not thread safe**. A :c:type:`PyBytesWriter` object must only
309-
be used by a single thread, it must not be shared between threads.
308+
The API is **not thread safe**. To share a writer with multiple threads, a
309+
critical section or a lock is needed.
310310
311311
The instance must be destroyed by :c:func:`PyBytesWriter_Finish` on
312312
success, or :c:func:`PyBytesWriter_Discard` on error.

‎Doc/c-api/unicode.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,6 +1797,9 @@ object.
17971797
The instance must be destroyed by :c:func:`PyUnicodeWriter_Finish` on
17981798
success, or :c:func:`PyUnicodeWriter_Discard` on error.
17991799
1800+
The API is **not thread safe**. To share a writer with multiple threads, a
1801+
critical section or a lock is needed.
1802+
18001803
.. c:function:: PyUnicodeWriter* PyUnicodeWriter_Create(Py_ssize_t length)
18011804
18021805
Create a Unicode writer instance.

‎Doc/library/importlib.rst‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,11 @@ ABC hierarchy::
355355
See :pep:`302` for the exact definition for a loader.
356356

357357
Loaders that wish to support resource reading should implement a
358-
:meth:`get_resource_reader` method as specified by
358+
:meth:`!get_resource_reader` method as specified by
359359
:class:`importlib.resources.abc.ResourceReader`.
360360

361361
.. versionchanged:: 3.7
362-
Introduced the optional :meth:`get_resource_reader` method.
362+
Introduced the optional :meth:`!get_resource_reader` method.
363363

364364
.. versionchanged:: 3.15
365365
Removed the ``load_module()`` method.
@@ -717,7 +717,8 @@ find and load modules.
717717

718718
.. versionchanged:: 3.5
719719
As part of :pep:`489`, the builtin importer now implements
720-
:meth:`Loader.create_module` and :meth:`Loader.exec_module`
720+
:meth:`Loader.create_module <importlib.abc.Loader.create_module>`
721+
and :meth:`Loader.exec_module <importlib.abc.Loader.exec_module>`
721722

722723

723724
.. class:: FrozenImporter
@@ -730,7 +731,8 @@ find and load modules.
730731
instantiation.
731732

732733
.. versionchanged:: 3.4
733-
Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module`
734+
Gained :meth:`~importlib.abc.Loader.create_module` and
735+
:meth:`~importlib.abc.Loader.exec_module`
734736
methods.
735737

736738

@@ -1180,8 +1182,8 @@ an :term:`importer`.
11801182
with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the return
11811183
value would be ``/foo/bar/__pycache__/baz.cpython-32.pyc`` for Python 3.2.
11821184
The ``cpython-32`` string comes from the current magic tag (see
1183-
:func:`get_tag`; if :attr:`sys.implementation.cache_tag` is not defined then
1184-
:exc:`NotImplementedError` will be raised).
1185+
:attr:`sys.implementation.cache_tag <sys.implementation>`; if it is not
1186+
defined then :exc:`NotImplementedError` will be raised).
11851187

11861188
The *optimization* parameter is used to specify the optimization level of the
11871189
bytecode file. An empty string represents no optimization, so
@@ -1213,7 +1215,7 @@ an :term:`importer`.
12131215
``/foo/bar/__pycache__/baz.cpython-32.pyc`` the returned path would be
12141216
``/foo/bar/baz.py``. *path* need not exist, however if it does not conform
12151217
to :pep:`3147` or :pep:`488` format, a :exc:`ValueError` is raised. If
1216-
:attr:`sys.implementation.cache_tag` is not defined,
1218+
:attr:`sys.implementation.cache_tag <sys.implementation>` is not defined,
12171219
:exc:`NotImplementedError` is raised.
12181220

12191221
.. versionadded:: 3.4
@@ -1263,7 +1265,8 @@ an :term:`importer`.
12631265
If **name** is for a submodule (contains a dot), the parent module is
12641266
automatically imported.
12651267

1266-
**name** and **package** work the same as for :func:`import_module`.
1268+
**name** and **package** work the same as for
1269+
:func:`importlib.import_module`.
12671270

12681271
.. versionadded:: 3.4
12691272

@@ -1293,7 +1296,8 @@ an :term:`importer`.
12931296
A factory function for creating a :class:`~importlib.machinery.ModuleSpec`
12941297
instance based on a loader. The parameters have the same meaning as they do
12951298
for ModuleSpec. The function uses available :term:`loader` APIs, such as
1296-
:meth:`InspectLoader.is_package`, to fill in any missing
1299+
:meth:`InspectLoader.is_package
1300+
<importlib.abc.InspectLoader.is_package>`, to fill in any missing
12971301
information on the spec.
12981302

12991303
.. versionadded:: 3.4

‎Doc/library/re.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ character ``'$'``.
614614

615615
Matches ``[0-9]`` if the :py:const:`~re.ASCII` flag is used.
616616

617-
__ https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-4/#G124142
617+
__ https://www.unicode.org/versions/Unicode18.0.0/core-spec/chapter-4/#G124142
618618

619619
For 8-bit (bytes) patterns:
620620
Matches any decimal digit in the ASCII character set;

‎Doc/library/unicodedata.rst‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
This module provides access to the Unicode Character Database (UCD) which
1515
defines character properties for all Unicode characters. The data contained in
16-
this database is compiled from the `UCD version 17.0.0
17-
<https://www.unicode.org/Public/17.0.0/ucd>`_.
16+
this database is compiled from the `UCD version 18.0.0
17+
<https://www.unicode.org/Public/18.0.0/ucd>`_.
1818

1919
The module uses the same names and symbols as defined by Unicode
2020
Standard Annex #44, `"Unicode Character Database"
@@ -170,7 +170,7 @@ Standard Annex #44, `"Unicode Character Database"
170170
.. function:: block(chr, /)
171171

172172
Returns the `block
173-
<https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G64189>`_
173+
<https://www.unicode.org/versions/Unicode18.0.0/core-spec/chapter-3/#G64189>`_
174174
assigned to the character *chr*. For example::
175175

176176
>>> unicodedata.block('S')
@@ -326,6 +326,6 @@ In addition, the module exposes the following constants:
326326

327327
.. rubric:: Footnotes
328328

329-
.. [#] https://www.unicode.org/Public/17.0.0/ucd/NameAliases.txt
329+
.. [#] https://www.unicode.org/Public/18.0.0/ucd/NameAliases.txt
330330
331-
.. [#] https://www.unicode.org/Public/17.0.0/ucd/NamedSequences.txt
331+
.. [#] https://www.unicode.org/Public/18.0.0/ucd/NamedSequences.txt

‎Doc/reference/lexical_analysis.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,8 @@ Unicode categories use the version of the Unicode Character Database as
602602
included in the :mod:`unicodedata` module.
603603

604604
.. _UAX-31: https://www.unicode.org/reports/tr31/
605-
.. _PropList.txt: https://www.unicode.org/Public/17.0.0/ucd/PropList.txt
606-
.. _DerivedCoreProperties.txt: https://www.unicode.org/Public/17.0.0/ucd/DerivedCoreProperties.txt
605+
.. _PropList.txt: https://www.unicode.org/Public/18.0.0/ucd/PropList.txt
606+
.. _DerivedCoreProperties.txt: https://www.unicode.org/Public/18.0.0/ucd/DerivedCoreProperties.txt
607607
.. _normalization form: https://www.unicode.org/reports/tr15/#Norm_Forms
608608

609609
.. seealso::
@@ -916,7 +916,7 @@ with the given *name*::
916916
This sequence cannot appear in :ref:`bytes literals <bytes-literal>`.
917917

918918
.. versionchanged:: 3.3
919-
Support for `name aliases <https://www.unicode.org/Public/17.0.0/ucd/NameAliases.txt>`__
919+
Support for `name aliases <https://www.unicode.org/Public/18.0.0/ucd/NameAliases.txt>`__
920920
has been added.
921921

922922
.. _string-escape-long-hex:

‎Doc/tools/.nitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Doc/library/ast.rst
66
Doc/library/asyncio-extending.rst
77
Doc/library/email.charset.rst
88
Doc/library/email.parser.rst
9-
Doc/library/importlib.rst
109
Doc/library/logging.config.rst
1110
Doc/library/logging.handlers.rst
1211
Doc/library/mmap.rst

‎Doc/whatsnew/3.16.rst‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,11 @@ tkinter
695695
with no unit suffix to :class:`int` or :class:`float`.
696696
(Contributed by Serhiy Storchaka in :gh:`153513`.)
697697

698+
unicodedata
699+
-----------
700+
701+
* The Unicode database has been updated to Unicode 18.0.0.
702+
698703
xml
699704
---
700705

‎Grammar/python.gram‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,8 +1181,12 @@ invalid_arguments:
11811181
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, _PyPegen_get_last_comprehension_item(PyPegen_last_item(b, comprehension_ty)), "Generator expression must be parenthesized") }
11821182
| a=args ',' args { _PyPegen_arguments_parsing_error(p, a) }
11831183
invalid_kwarg:
1184-
| a[Token*]=('True'|'False'|'None') b='=' {
1185-
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "cannot assign to %s", PyBytes_AS_STRING(a->bytes)) }
1184+
| a='True' b='=' {
1185+
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "cannot assign to True") }
1186+
| a='False' b='=' {
1187+
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "cannot assign to False") }
1188+
| a='None' b='=' {
1189+
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "cannot assign to None") }
11861190
| a=NAME b='=' expression for_if_clauses {
11871191
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "invalid syntax. Maybe you meant '==' or ':=' instead of '='?")}
11881192
| !(NAME '=') a=expression b='=' {

0 commit comments

Comments
 (0)