Skip to content

Commit 9c01810

Browse files
authored
Merge branch 'main' into complex-realimag-asdouble
2 parents b30c9f4 + b0699aa commit 9c01810

File tree

505 files changed

+8789
-5378
lines changed

Some content is hidden

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

505 files changed

+8789
-5378
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ body:
3939
- "3.10"
4040
- "3.11"
4141
- "3.12"
42+
- "3.13"
4243
- "CPython main branch"
4344
validations:
4445
required: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ gmon.out
4242
.coverage
4343
.mypy_cache/
4444
.pytest_cache/
45+
.ruff_cache/
4546
.DS_Store
4647

4748
*.exe

.pre-commit-config.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.0.292
3+
rev: v0.1.2
44
hooks:
55
- id: ruff
66
name: Run Ruff on Lib/test/
@@ -12,7 +12,7 @@ repos:
1212
files: ^Tools/clinic/|Lib/test/test_clinic.py
1313

1414
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v4.4.0
15+
rev: v4.5.0
1616
hooks:
1717
- id: check-toml
1818
exclude: ^Lib/test/test_tomllib/
@@ -24,12 +24,11 @@ repos:
2424
types_or: [c, inc, python, rst]
2525

2626
- repo: https://github.com/sphinx-contrib/sphinx-lint
27-
rev: v0.7.0
27+
rev: v0.8.1
2828
hooks:
2929
- id: sphinx-lint
30-
args: [--enable=default-role, -j1]
30+
args: [--enable=default-role]
3131
files: ^Doc/|^Misc/NEWS.d/next/
32-
types: [rst]
3332

3433
- repo: meta
3534
hooks:

Doc/c-api/arg.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,10 @@ API Functions
416416
.. c:function:: int PyArg_ParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], ...)
417417
418418
Parse the parameters of a function that takes both positional and keyword
419-
parameters into local variables. The *keywords* argument is a
420-
``NULL``-terminated array of keyword parameter names. Empty names denote
419+
parameters into local variables.
420+
The *keywords* argument is a ``NULL``-terminated array of keyword parameter
421+
names specified as null-terminated ASCII or UTF-8 encoded C strings.
422+
Empty names denote
421423
:ref:`positional-only parameters <positional-only_parameter>`.
422424
Returns true on success; on failure, it returns false and raises the
423425
appropriate exception.
@@ -426,6 +428,9 @@ API Functions
426428
Added support for :ref:`positional-only parameters
427429
<positional-only_parameter>`.
428430
431+
.. versionchanged:: 3.13
432+
Added support for non-ASCII keyword parameter names.
433+
429434
430435
.. c:function:: int PyArg_VaParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], va_list vargs)
431436

Doc/c-api/call.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ This is a pointer to a function with the following signature:
108108
Doing so will allow callables such as bound methods to make their onward
109109
calls (which include a prepended *self* argument) very efficiently.
110110

111+
.. versionadded:: 3.8
112+
111113
To call an object that implements vectorcall, use a :ref:`call API <capi-call>`
112114
function as with any other callable.
113115
:c:func:`PyObject_Vectorcall` will usually be most efficient.

Doc/c-api/init_config.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ PyConfig
716716
717717
Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable.
718718
719-
Need a special build of Python with the ``Py_TRACE_REFS`` macro defined:
719+
Needs a special build of Python with the ``Py_TRACE_REFS`` macro defined:
720720
see the :option:`configure --with-trace-refs option <--with-trace-refs>`.
721721
722722
Default: ``0``.
@@ -1048,7 +1048,7 @@ PyConfig
10481048
Incremented by the :option:`-d` command line option. Set to the
10491049
:envvar:`PYTHONDEBUG` environment variable value.
10501050
1051-
Need a :ref:`debug build of Python <debug-build>` (the ``Py_DEBUG`` macro
1051+
Needs a :ref:`debug build of Python <debug-build>` (the ``Py_DEBUG`` macro
10521052
must be defined).
10531053
10541054
Default: ``0``.
@@ -1100,6 +1100,7 @@ PyConfig
11001100
11011101
Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and
11021102
the :envvar:`PYTHONPYCACHEPREFIX` environment variable.
1103+
The command-line option takes precedence.
11031104
11041105
If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``.
11051106
@@ -1143,13 +1144,27 @@ PyConfig
11431144
11441145
Default: ``NULL``.
11451146
1147+
.. c:member:: wchar_t* run_presite
1148+
1149+
``package.module`` path to module that should be imported before
1150+
``site.py`` is run.
1151+
1152+
Set by the :option:`-X presite=package.module <-X>` command-line
1153+
option and the :envvar:`PYTHON_PRESITE` environment variable.
1154+
The command-line option takes precedence.
1155+
1156+
Needs a :ref:`debug build of Python <debug-build>` (the ``Py_DEBUG`` macro
1157+
must be defined).
1158+
1159+
Default: ``NULL``.
1160+
11461161
.. c:member:: int show_ref_count
11471162
11481163
Show total reference count at exit (excluding immortal objects)?
11491164
11501165
Set to ``1`` by :option:`-X showrefcount <-X>` command line option.
11511166
1152-
Need a :ref:`debug build of Python <debug-build>` (the ``Py_REF_DEBUG``
1167+
Needs a :ref:`debug build of Python <debug-build>` (the ``Py_REF_DEBUG``
11531168
macro must be defined).
11541169
11551170
Default: ``0``.

Doc/c-api/memory.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,8 @@ The pymalloc allocator
626626
627627
Python has a *pymalloc* allocator optimized for small objects (smaller or equal
628628
to 512 bytes) with a short lifetime. It uses memory mappings called "arenas"
629-
with a fixed size of 256 KiB. It falls back to :c:func:`PyMem_RawMalloc` and
629+
with a fixed size of either 256 KiB on 32-bit platforms or 1 MiB on 64-bit
630+
platforms. It falls back to :c:func:`PyMem_RawMalloc` and
630631
:c:func:`PyMem_RawRealloc` for allocations larger than 512 bytes.
631632
632633
*pymalloc* is the :ref:`default allocator <default-memory-allocators>` of the

Doc/c-api/set.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,6 @@ subtypes but not for instances of :class:`frozenset` or its subtypes.
163163
164164
.. c:function:: int PySet_Clear(PyObject *set)
165165
166-
Empty an existing set of all elements.
166+
Empty an existing set of all elements. Return ``0`` on
167+
success. Return ``-1`` and raise :exc:`SystemError` if *set* is not an instance of
168+
:class:`set` or its subtype.

Doc/c-api/unicode.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,8 +971,8 @@ These are the UTF-8 codec APIs:
971971
returned buffer always has an extra null byte appended (not included in
972972
*size*), regardless of whether there are any other null code points.
973973
974-
In the case of an error, ``NULL`` is returned with an exception set and no
975-
*size* is stored.
974+
On error, set an exception, set *size* to ``-1`` (if it's not NULL) and
975+
return ``NULL``.
976976
977977
This caches the UTF-8 representation of the string in the Unicode object, and
978978
subsequent calls will return a pointer to the same buffer. The caller is not
@@ -992,11 +992,19 @@ These are the UTF-8 codec APIs:
992992
993993
As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size.
994994
995+
Raise an exception if the *unicode* string contains embedded null
996+
characters. To accept embedded null characters and truncate on purpose
997+
at the first null byte, ``PyUnicode_AsUTF8AndSize(unicode, NULL)`` can be
998+
used instead.
999+
9951000
.. versionadded:: 3.3
9961001
9971002
.. versionchanged:: 3.7
9981003
The return type is now ``const char *`` rather of ``char *``.
9991004
1005+
.. versionchanged:: 3.13
1006+
Raise an exception if the string contains embedded null characters.
1007+
10001008
10011009
UTF-32 Codecs
10021010
"""""""""""""

Doc/data/stable_abi.dat

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)