Skip to content

Commit 434dbab

Browse files
Merge branch 'main' into tsan
2 parents 93830ea + d6c89a2 commit 434dbab

36 files changed

+367
-187
lines changed

Doc/c-api/dict.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ Dictionary Objects
245245
``len(p)`` on a dictionary.
246246
247247
248+
.. c:function:: Py_ssize_t PyDict_GET_SIZE(PyObject *p)
249+
250+
Similar to :c:func:`PyDict_Size`, but without error checking.
251+
252+
248253
.. c:function:: int PyDict_Next(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
249254
250255
Iterate over all key-value pairs in the dictionary *p*. The

Doc/c-api/float.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,23 @@ Floating-Point Objects
7878
Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`.
7979
8080
81+
.. c:macro:: Py_RETURN_NAN
82+
83+
Return :data:`math.nan` from a function.
84+
85+
On most platforms, this is equivalent to ``return PyFloat_FromDouble(NAN)``.
86+
87+
88+
.. c:macro:: Py_RETURN_INF(sign)
89+
90+
Return :data:`math.inf` or :data:`-math.inf <math.inf>` from a function,
91+
depending on the sign of *sign*.
92+
93+
On most platforms, this is equivalent to the following::
94+
95+
return PyFloat_FromDouble(copysign(INFINITY, sign));
96+
97+
8198
Pack and Unpack functions
8299
-------------------------
83100

Doc/c-api/function.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ There are a few functions specific to Python functions.
200200
runtime behavior depending on optimization decisions, it does not change
201201
the semantics of the Python code being executed.
202202
203-
If *event* is ``PyFunction_EVENT_DESTROY``, Taking a reference in the
203+
If *event* is ``PyFunction_EVENT_DESTROY``, taking a reference in the
204204
callback to the about-to-be-destroyed function will resurrect it, preventing
205205
it from being freed at this time. When the resurrected object is destroyed
206206
later, any watcher callbacks active at that time will be called again.

Doc/c-api/iterator.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,32 @@ sentinel value is returned.
5050
callable object that can be called with no parameters; each call to it should
5151
return the next item in the iteration. When *callable* returns a value equal to
5252
*sentinel*, the iteration will be terminated.
53+
54+
55+
Other Iterator Objects
56+
^^^^^^^^^^^^^^^^^^^^^^
57+
58+
.. c:var:: PyTypeObject PyByteArrayIter_Type
59+
.. c:var:: PyTypeObject PyBytesIter_Type
60+
.. c:var:: PyTypeObject PyListIter_Type
61+
.. c:var:: PyTypeObject PyListRevIter_Type
62+
.. c:var:: PyTypeObject PySetIter_Type
63+
.. c:var:: PyTypeObject PyTupleIter_Type
64+
.. c:var:: PyTypeObject PyRangeIter_Type
65+
.. c:var:: PyTypeObject PyLongRangeIter_Type
66+
.. c:var:: PyTypeObject PyDictIterKey_Type
67+
.. c:var:: PyTypeObject PyDictRevIterKey_Type
68+
.. c:var:: PyTypeObject PyDictIterValue_Type
69+
.. c:var:: PyTypeObject PyDictRevIterValue_Type
70+
.. c:var:: PyTypeObject PyDictIterItem_Type
71+
.. c:var:: PyTypeObject PyDictRevIterItem_Type
72+
73+
Type objects for iterators of various built-in objects.
74+
75+
Do not create instances of these directly; prefer calling
76+
:c:func:`PyObject_GetIter` instead.
77+
78+
Note that there is no guarantee that a given built-in type uses a given iterator
79+
type. For example, iterating over :class:`range` will use one of two iterator
80+
types depending on the size of the range. Other types may start using a
81+
similar scheme in the future, without warning.

Doc/c-api/memoryview.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ A :class:`memoryview` object exposes the C level :ref:`buffer interface
1313
any other object.
1414

1515

16+
.. c:var:: PyTypeObject PyMemoryView_Type
17+
18+
This instance of :c:type:`PyTypeObject` represents the Python memoryview
19+
type. This is the same object as :class:`memoryview` in the Python layer.
20+
21+
1622
.. c:function:: PyObject *PyMemoryView_FromObject(PyObject *obj)
1723
1824
Create a memoryview object from an object that provides the buffer interface.

Doc/data/stable_abi.dat

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

Doc/library/argparse.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2070,7 +2070,9 @@ Parser defaults
20702070
>>> parser.parse_args(['736'])
20712071
Namespace(bar=42, baz='badger', foo=736)
20722072

2073-
Note that parser-level defaults always override argument-level defaults::
2073+
Note that defaults can be set at both the parser level using :meth:`set_defaults`
2074+
and at the argument level using :meth:`add_argument`. If both are called for the
2075+
same argument, the last default set for an argument is used::
20742076

20752077
>>> parser = argparse.ArgumentParser()
20762078
>>> parser.add_argument('--foo', default='bar')

Doc/library/asyncio-eventloop.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,6 +1631,9 @@ async/await code consider using the high-level
16311631
conforms to the :class:`asyncio.SubprocessTransport` base class and
16321632
*protocol* is an object instantiated by the *protocol_factory*.
16331633

1634+
If the transport is closed or is garbage collected, the child process
1635+
is killed if it is still running.
1636+
16341637
.. method:: loop.subprocess_shell(protocol_factory, cmd, *, \
16351638
stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
16361639
stderr=subprocess.PIPE, **kwargs)
@@ -1654,6 +1657,9 @@ async/await code consider using the high-level
16541657
conforms to the :class:`SubprocessTransport` base class and
16551658
*protocol* is an object instantiated by the *protocol_factory*.
16561659

1660+
If the transport is closed or is garbage collected, the child process
1661+
is killed if it is still running.
1662+
16571663
.. note::
16581664
It is the application's responsibility to ensure that all whitespace
16591665
and special characters are quoted appropriately to avoid `shell injection

Doc/library/asyncio-subprocess.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ Creating Subprocesses
7676
See the documentation of :meth:`loop.subprocess_exec` for other
7777
parameters.
7878

79+
If the process object is garbage collected while the process is still
80+
running, the child process will be killed.
81+
7982
.. versionchanged:: 3.10
8083
Removed the *loop* parameter.
8184

@@ -95,6 +98,9 @@ Creating Subprocesses
9598
See the documentation of :meth:`loop.subprocess_shell` for other
9699
parameters.
97100

101+
If the process object is garbage collected while the process is still
102+
running, the child process will be killed.
103+
98104
.. important::
99105

100106
It is the application's responsibility to ensure that all whitespace and

Doc/library/asyncio.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ You can experiment with an ``asyncio`` concurrent context in the :term:`REPL`:
7979
>>> await asyncio.sleep(10, result='hello')
8080
'hello'
8181
82+
This REPL provides limited compatibility with :envvar:`PYTHON_BASIC_REPL`.
83+
It is recommended that the default REPL is used
84+
for full functionality and the latest features.
85+
8286
.. audit-event:: cpython.run_stdin "" ""
8387

8488
.. versionchanged:: 3.12.5 (also 3.11.10, 3.10.15, 3.9.20, and 3.8.20)

0 commit comments

Comments
 (0)