Skip to content

Commit 5b55760

Browse files
Merge remote-tracking branch 'upstream/main' into deferred_gc
2 parents 634adcc + 722229e commit 5b55760

File tree

128 files changed

+2822
-1869
lines changed

Some content is hidden

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

128 files changed

+2822
-1869
lines changed

Doc/c-api/dict.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Dictionary Objects
156156
157157
.. c:function:: int PyDict_GetItemStringRef(PyObject *p, const char *key, PyObject **result)
158158
159-
Similar than :c:func:`PyDict_GetItemRef`, but *key* is specified as a
159+
Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as a
160160
:c:expr:`const char*` UTF-8 encoded bytes string, rather than a
161161
:c:expr:`PyObject*`.
162162
@@ -206,7 +206,7 @@ Dictionary Objects
206206
``NULL``, and return ``0``.
207207
- On error, raise an exception and return ``-1``.
208208
209-
This is similar to :meth:`dict.pop`, but without the default value and
209+
Similar to :meth:`dict.pop`, but without the default value and
210210
not raising :exc:`KeyError` if the key missing.
211211
212212
.. versionadded:: 3.13

Doc/c-api/typeobj.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
15921592
weak references to the type object itself.
15931593

15941594
It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit and
1595-
:c:member:`~PyTypeObject.tp_weaklist`.
1595+
:c:member:`~PyTypeObject.tp_weaklistoffset`.
15961596

15971597
**Inheritance:**
15981598

@@ -1604,7 +1604,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
16041604
**Default:**
16051605

16061606
If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the
1607-
:c:member:`~PyTypeObject.tp_dict` field, then
1607+
:c:member:`~PyTypeObject.tp_flags` field, then
16081608
:c:member:`~PyTypeObject.tp_weaklistoffset` will be set to a negative value,
16091609
to indicate that it is unsafe to use this field.
16101610

Doc/howto/logging.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,46 @@ following diagram.
385385
.. raw:: html
386386
:file: logging_flow.svg
387387

388+
.. raw:: html
389+
390+
<script>
391+
/*
392+
* This snippet is needed to handle the case where a light or dark theme is
393+
* chosen via the theme is selected in the page. We call the existing handler
394+
* and then add a dark-theme class to the body when the dark theme is selected.
395+
* The SVG styling (above) then does the rest.
396+
*
397+
* If the pydoc theme is updated to set the dark-theme class, this snippet
398+
* won't be needed any more.
399+
*/
400+
(function() {
401+
var oldActivateTheme = activateTheme;
402+
403+
function updateBody(theme) {
404+
let elem = document.body;
405+
406+
elem.classList.remove('dark-theme');
407+
elem.classList.remove('light-theme');
408+
if (theme === 'dark') {
409+
elem.classList.add('dark-theme');
410+
}
411+
else if (theme === 'light') {
412+
elem.classList.add('light-theme');
413+
}
414+
}
415+
416+
activateTheme = function(theme) {
417+
oldActivateTheme(theme);
418+
updateBody(theme);
419+
};
420+
/*
421+
* If the page is refreshed, make sure we update the body - the overriding
422+
* of activateTheme won't have taken effect yet.
423+
*/
424+
updateBody(localStorage.getItem('currentTheme') || 'auto');
425+
})();
426+
</script>
427+
388428
Loggers
389429
^^^^^^^
390430

Doc/howto/logging_flow.svg

Lines changed: 180 additions & 134 deletions
Loading

Doc/library/ctypes.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,20 @@ Fundamental data types
266266
(1)
267267
The constructor accepts any object with a truth value.
268268

269+
Additionally, if IEC 60559 compatible complex arithmetic (Annex G) is supported, the following
270+
complex types are available:
271+
272+
+----------------------------------+---------------------------------+-----------------+
273+
| ctypes type | C type | Python type |
274+
+==================================+=================================+=================+
275+
| :class:`c_float_complex` | :c:expr:`float complex` | complex |
276+
+----------------------------------+---------------------------------+-----------------+
277+
| :class:`c_double_complex` | :c:expr:`double complex` | complex |
278+
+----------------------------------+---------------------------------+-----------------+
279+
| :class:`c_longdouble_complex` | :c:expr:`long double complex` | complex |
280+
+----------------------------------+---------------------------------+-----------------+
281+
282+
269283
All these types can be created by calling them with an optional initializer of
270284
the correct type and value::
271285

@@ -2284,6 +2298,30 @@ These are the fundamental ctypes data types:
22842298
optional float initializer.
22852299

22862300

2301+
.. class:: c_double_complex
2302+
2303+
Represents the C :c:expr:`double complex` datatype, if available. The
2304+
constructor accepts an optional :class:`complex` initializer.
2305+
2306+
.. versionadded:: 3.14
2307+
2308+
2309+
.. class:: c_float_complex
2310+
2311+
Represents the C :c:expr:`float complex` datatype, if available. The
2312+
constructor accepts an optional :class:`complex` initializer.
2313+
2314+
.. versionadded:: 3.14
2315+
2316+
2317+
.. class:: c_longdouble_complex
2318+
2319+
Represents the C :c:expr:`long double complex` datatype, if available. The
2320+
constructor accepts an optional :class:`complex` initializer.
2321+
2322+
.. versionadded:: 3.14
2323+
2324+
22872325
.. class:: c_int
22882326

22892327
Represents the C :c:expr:`signed int` datatype. The constructor accepts an

Doc/library/os.rst

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,10 +1724,27 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
17241724
Added support for pipes on Windows.
17251725

17261726

1727-
.. function:: splice(src, dst, count, offset_src=None, offset_dst=None)
1727+
.. function:: splice(src, dst, count, offset_src=None, offset_dst=None, flags=0)
17281728

17291729
Transfer *count* bytes from file descriptor *src*, starting from offset
17301730
*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*.
1731+
1732+
The splicing behaviour can be modified by specifying a *flags* value.
1733+
Any of the following variables may used, combined using bitwise OR
1734+
(the ``|`` operator):
1735+
1736+
* If :const:`SPLICE_F_MOVE` is specified,
1737+
the kernel is asked to move pages instead of copying,
1738+
but pages may still be copied if the kernel cannot move the pages from the pipe.
1739+
1740+
* If :const:`SPLICE_F_NONBLOCK` is specified,
1741+
the kernel is asked to not block on I/O.
1742+
This makes the splice pipe operations nonblocking,
1743+
but splice may nevertheless block because the spliced file descriptors may block.
1744+
1745+
* If :const:`SPLICE_F_MORE` is specified,
1746+
it hints to the kernel that more data will be coming in a subsequent splice.
1747+
17311748
At least one of the file descriptors must refer to a pipe. If *offset_src*
17321749
is ``None``, then *src* is read from the current position; respectively for
17331750
*offset_dst*. The offset associated to the file descriptor that refers to a
@@ -1746,6 +1763,8 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
17461763
make sense to block because there are no writers connected to the write end
17471764
of the pipe.
17481765

1766+
.. seealso:: The :manpage:`splice(2)` man page.
1767+
17491768
.. availability:: Linux >= 2.6.17 with glibc >= 2.5
17501769

17511770
.. versionadded:: 3.10
@@ -4642,6 +4661,10 @@ written in Python, such as a mail server's external command delivery program.
46424661
Use :class:`subprocess.Popen` or :func:`subprocess.run` to
46434662
control options like encodings.
46444663

4664+
.. deprecated:: 3.14
4665+
The function is :term:`soft deprecated` and should no longer be used to
4666+
write new code. The :mod:`subprocess` module is recommended instead.
4667+
46454668

46464669
.. function:: posix_spawn(path, argv, env, *, file_actions=None, \
46474670
setpgroup=None, resetids=False, setsid=False, setsigmask=(), \
@@ -4868,6 +4891,10 @@ written in Python, such as a mail server's external command delivery program.
48684891
.. versionchanged:: 3.6
48694892
Accepts a :term:`path-like object`.
48704893

4894+
.. deprecated:: 3.14
4895+
These functions are :term:`soft deprecated` and should no longer be used
4896+
to write new code. The :mod:`subprocess` module is recommended instead.
4897+
48714898

48724899
.. data:: P_NOWAIT
48734900
P_NOWAITO
@@ -4972,7 +4999,7 @@ written in Python, such as a mail server's external command delivery program.
49724999
shell documentation.
49735000

49745001
The :mod:`subprocess` module provides more powerful facilities for spawning
4975-
new processes and retrieving their results; using that module is preferable
5002+
new processes and retrieving their results; using that module is recommended
49765003
to using this function. See the :ref:`subprocess-replacements` section in
49775004
the :mod:`subprocess` documentation for some helpful recipes.
49785005

0 commit comments

Comments
 (0)