Skip to content

Commit 0ebacd9

Browse files
committed
Merge in the main branch; run make regen-configure
2 parents bc635b0 + 0c6c09b commit 0ebacd9

File tree

123 files changed

+1237
-497
lines changed

Some content is hidden

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

123 files changed

+1237
-497
lines changed

Doc/c-api/function.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ There are a few functions specific to Python functions.
9595
9696
.. versionadded:: 3.12
9797
98+
99+
.. c:function:: PyObject* PyFunction_GetKwDefaults(PyObject *op)
100+
101+
Return the keyword-only argument default values of the function object *op*. This can be a
102+
dictionary of arguments or ``NULL``.
103+
104+
98105
.. c:function:: PyObject* PyFunction_GetClosure(PyObject *op)
99106
100107
Return the closure associated with the function object *op*. This can be ``NULL``
@@ -123,6 +130,19 @@ There are a few functions specific to Python functions.
123130
Raises :exc:`SystemError` and returns ``-1`` on failure.
124131
125132
133+
.. c:function:: PyObject *PyFunction_GET_CODE(PyObject *op)
134+
PyObject *PyFunction_GET_GLOBALS(PyObject *op)
135+
PyObject *PyFunction_GET_MODULE(PyObject *op)
136+
PyObject *PyFunction_GET_DEFAULTS(PyObject *op)
137+
PyObject *PyFunction_GET_KW_DEFAULTS(PyObject *op)
138+
PyObject *PyFunction_GET_CLOSURE(PyObject *op)
139+
PyObject *PyFunction_GET_ANNOTATIONS(PyObject *op)
140+
141+
These functions are similar to their ``PyFunction_Get*`` counterparts, but
142+
do not do type checking. Passing anything other than an instance of
143+
:c:data:`PyFunction_Type` is undefined behavior.
144+
145+
126146
.. c:function:: int PyFunction_AddWatcher(PyFunction_WatchCallback callback)
127147
128148
Register *callback* as a function watcher for the current interpreter.

Doc/c-api/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
12501250
.. c:function:: void PyInterpreterState_Clear(PyInterpreterState *interp)
12511251
12521252
Reset all information in an interpreter state object. There must be
1253-
an :term:`attached thread state` for the the interpreter.
1253+
an :term:`attached thread state` for the interpreter.
12541254
12551255
.. audit-event:: cpython.PyInterpreterState_Clear "" c.PyInterpreterState_Clear
12561256

Doc/c-api/long.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
439439
All *n_bytes* of the buffer are written: large buffers are padded with
440440
zeroes.
441441
442-
If the returned value is greater than than *n_bytes*, the value was
442+
If the returned value is greater than *n_bytes*, the value was
443443
truncated: as many of the lowest bits of the value as could fit are written,
444444
and the higher bits are ignored. This matches the typical behavior
445445
of a C-style downcast.

Doc/data/refcounts.dat

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,21 +963,45 @@ PyFunction_Check:PyObject*:o:0:
963963
PyFunction_GetAnnotations:PyObject*::0:
964964
PyFunction_GetAnnotations:PyObject*:op:0:
965965

966+
PyFunction_GET_ANNOTATIONS:PyObject*::0:
967+
PyFunction_GET_ANNOTATIONS:PyObject*:op:0:
968+
966969
PyFunction_GetClosure:PyObject*::0:
967970
PyFunction_GetClosure:PyObject*:op:0:
968971

972+
PyFunction_GET_CLOSURE:PyObject*::0:
973+
PyFunction_GET_CLOSURE:PyObject*:op:0:
974+
969975
PyFunction_GetCode:PyObject*::0:
970976
PyFunction_GetCode:PyObject*:op:0:
971977

978+
PyFunction_GET_CODE:PyObject*::0:
979+
PyFunction_GET_CODE:PyObject*:op:0:
980+
972981
PyFunction_GetDefaults:PyObject*::0:
973982
PyFunction_GetDefaults:PyObject*:op:0:
974983

984+
PyFunction_GET_DEFAULTS:PyObject*::0:
985+
PyFunction_GET_DEFAULTS:PyObject*:op:0:
986+
987+
PyFunction_GetKwDefaults:PyObject*::0:
988+
PyFunction_GetKwDefaults:PyObject*:op:0:
989+
990+
PyFunction_GET_KW_DEFAULTS:PyObject*::0:
991+
PyFunction_GET_KW_DEFAULTS:PyObject*:op:0:
992+
975993
PyFunction_GetGlobals:PyObject*::0:
976994
PyFunction_GetGlobals:PyObject*:op:0:
977995

996+
PyFunction_GET_GLOBALS:PyObject*::0:
997+
PyFunction_GET_GLOBALS:PyObject*:op:0:
998+
978999
PyFunction_GetModule:PyObject*::0:
9791000
PyFunction_GetModule:PyObject*:op:0:
9801001

1002+
PyFunction_GET_MODULE:PyObject*::0:
1003+
PyFunction_GET_MODULE:PyObject*:op:0:
1004+
9811005
PyFunction_New:PyObject*::+1:
9821006
PyFunction_New:PyObject*:code:+1:
9831007
PyFunction_New:PyObject*:globals:+1:

Doc/extending/newtypes_tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ be an instance of a subclass.
277277
The explicit cast to ``CustomObject *`` above is needed because we defined
278278
``Custom_dealloc`` to take a ``PyObject *`` argument, as the ``tp_dealloc``
279279
function pointer expects to receive a ``PyObject *`` argument.
280-
By assigning to the the ``tp_dealloc`` slot of a type, we declare
280+
By assigning to the ``tp_dealloc`` slot of a type, we declare
281281
that it can only be called with instances of our ``CustomObject``
282282
class, so the cast to ``(CustomObject *)`` is safe.
283283
This is object-oriented polymorphism, in C!

Doc/howto/functional.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ generators:
602602
raise an exception inside the generator; the exception is raised by the
603603
``yield`` expression where the generator's execution is paused.
604604

605-
* :meth:`~generator.close` raises a :exc:`GeneratorExit` exception inside the
605+
* :meth:`~generator.close` sends a :exc:`GeneratorExit` exception to the
606606
generator to terminate the iteration. On receiving this exception, the
607607
generator's code must either raise :exc:`GeneratorExit` or
608608
:exc:`StopIteration`; catching the exception and doing anything else is

Doc/howto/isolating-extensions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ Avoiding ``PyObject_New``
453453

454454
GC-tracked objects need to be allocated using GC-aware functions.
455455

456-
If you use use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:
456+
If you use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:
457457

458458
- Get and call type's :c:member:`~PyTypeObject.tp_alloc` slot, if possible.
459459
That is, replace ``TYPE *o = PyObject_New(TYPE, typeobj)`` with::

Doc/library/argparse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ See also :ref:`specifying-ambiguous-arguments`. The supported values are:
955955

956956
.. index:: single: + (plus); in argparse module
957957

958-
* ``'+'``. Just like ``'*'``, all command-line args present are gathered into a
958+
* ``'+'``. Just like ``'*'``, all command-line arguments present are gathered into a
959959
list. Additionally, an error message will be generated if there wasn't at
960960
least one command-line argument present. For example::
961961

Doc/library/ctypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2965,7 +2965,7 @@ fields, or any other data types containing pointer type fields.
29652965
.. attribute:: is_anonymous
29662966

29672967
True if this field is anonymous, that is, it contains nested sub-fields
2968-
that should be be merged into a containing structure or union.
2968+
that should be merged into a containing structure or union.
29692969

29702970

29712971
.. _ctypes-arrays-pointers:

Doc/library/email.header.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ The :mod:`email.header` module also provides the following convenient functions.
206206

207207
.. note::
208208

209-
This function exists for for backwards compatibility only. For
209+
This function exists for backwards compatibility only. For
210210
new code, we recommend using :class:`email.headerregistry.HeaderRegistry`.
211211

212212

@@ -225,5 +225,5 @@ The :mod:`email.header` module also provides the following convenient functions.
225225

226226
.. note::
227227

228-
This function exists for for backwards compatibility only, and is
228+
This function exists for backwards compatibility only, and is
229229
not recommended for use in new code.

0 commit comments

Comments
 (0)