Merge remote-tracking branch 'upstream/main' into deferred_gc · python/cpython@5b55760 · GitHub
Skip to content

Commit 5b55760

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

128 files changed

Lines changed: 2822 additions & 1869 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/c-api/dict.rst

Lines changed: 2 additions & 2 deletions

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

0 commit comments

Comments
 (0)