From 0344db8d60621705af88daa7ff65bde063271f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20S=C5=82awecki?= Date: Mon, 13 Oct 2025 10:40:39 +0200 Subject: [PATCH 1/4] gh-131189: Remove `curses` mention from `PYTHON_BASIC_REPL` docs (#140022) The `curses` dependency for the default REPL has been removed in 09dfb50f1b7c23bc48d86bd579671761bb8ca48b. --- Doc/using/cmdline.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 74c18c2a6ede9c6..773fdabe99e0ed8 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -1277,9 +1277,8 @@ conflict. .. envvar:: PYTHON_BASIC_REPL If this variable is set to any value, the interpreter will not attempt to - load the Python-based :term:`REPL` that requires :mod:`curses` and - :mod:`readline`, and will instead use the traditional parser-based - :term:`REPL`. + load the Python-based :term:`REPL` that requires :mod:`readline`, and will + instead use the traditional parser-based :term:`REPL`. .. versionadded:: 3.13 From e6aa5152964647e548929a10d2d0fe2a7c5d875a Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Mon, 13 Oct 2025 12:28:25 +0200 Subject: [PATCH 2/4] gh-140009: Improve performance of `list_extend_dictitems` by using `PyTuple_FromArray` (#140010) --- .../2025-10-12-18-54-06.gh-issue-140009.-MbFh_.rst | 1 + Objects/listobject.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2025-10-12-18-54-06.gh-issue-140009.-MbFh_.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-10-12-18-54-06.gh-issue-140009.-MbFh_.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-10-12-18-54-06.gh-issue-140009.-MbFh_.rst new file mode 100644 index 000000000000000..97b35c88e17e370 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-10-12-18-54-06.gh-issue-140009.-MbFh_.rst @@ -0,0 +1 @@ +Improve performance of list extension by dictionary items. diff --git a/Objects/listobject.c b/Objects/listobject.c index b2903e5c93ee9ff..1722ea60cdc68fb 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1382,9 +1382,9 @@ list_extend_dictitems(PyListObject *self, PyDictObject *dict) PyObject **dest = self->ob_item + m; Py_ssize_t pos = 0; Py_ssize_t i = 0; - PyObject *key, *value; - while (_PyDict_Next((PyObject *)dict, &pos, &key, &value, NULL)) { - PyObject *item = PyTuple_Pack(2, key, value); + PyObject *key_value[2]; + while (_PyDict_Next((PyObject *)dict, &pos, &key_value[0], &key_value[1], NULL)) { + PyObject *item = PyTuple_FromArray(key_value, 2); if (item == NULL) { Py_SET_SIZE(self, m + i); return -1; From a00655b8775e00fb27644ac37c4e109d42dce5cd Mon Sep 17 00:00:00 2001 From: mdehoon Date: Mon, 13 Oct 2025 19:29:42 +0900 Subject: [PATCH 3/4] gh-140001: Remove obsolete TCL_WIN_SOCKET macro (from Tcl 7.x) from _tkinter.c (GH-139998) Co-authored-by: Michiel Jan Laurens de Hoon --- Modules/_tkinter.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index f0882191d3c3e81..c0ed8977d8fd6fa 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -82,33 +82,10 @@ typedef int Tcl_Size; #ifdef HAVE_CREATEFILEHANDLER -/* This bit is to ensure that TCL_UNIX_FD is defined and doesn't interfere - with the proper calculation of FHANDLETYPE == TCL_UNIX_FD below. */ -#ifndef TCL_UNIX_FD -# ifdef TCL_WIN_SOCKET -# define TCL_UNIX_FD (! TCL_WIN_SOCKET) -# else -# define TCL_UNIX_FD 1 -# endif -#endif - -/* Tcl_CreateFileHandler() changed several times; these macros deal with the - messiness. In Tcl 8.0 and later, it is not available on Windows (and on - Unix, only because Jack added it back); when available on Windows, it only - applies to sockets. */ - -#ifdef MS_WINDOWS -#define FHANDLETYPE TCL_WIN_SOCKET -#else -#define FHANDLETYPE TCL_UNIX_FD -#endif - /* If Tcl can wait for a Unix file descriptor, define the EventHook() routine which uses this to handle Tcl events while the user is typing commands. */ -#if FHANDLETYPE == TCL_UNIX_FD #define WAIT_FOR_STDIN -#endif #endif /* HAVE_CREATEFILEHANDLER */ From 52996aaa78706e0f2a70953feaf97b474eb438e7 Mon Sep 17 00:00:00 2001 From: Mikhail Efimov Date: Mon, 13 Oct 2025 14:23:09 +0300 Subject: [PATCH 4/4] gh-107073: fix relevant typo in `PyObject_ClearManagedDict` (#140032) --- Doc/c-api/object.rst | 2 +- Doc/c-api/typeobj.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst index 78599e704b1317c..56857929a5a72ac 100644 --- a/Doc/c-api/object.rst +++ b/Doc/c-api/object.rst @@ -600,7 +600,7 @@ Object Protocol Clear the managed dictionary of *obj*. - This function must only be called in a traverse function of the type which + This function must only be called in a clear function of the type which has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set. .. versionadded:: 3.13 diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 8bd3144f88aa71a..5b7cf0c45026a9a 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1704,7 +1704,7 @@ and :c:data:`PyType_Type` effectively act as defaults.) :c:func:`Py_CLEAR` macro performs the operations in a safe order. If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the - :c:member:`~PyTypeObject.tp_flags` field, the traverse function must call + :c:member:`~PyTypeObject.tp_flags` field, the clear function must call :c:func:`PyObject_ClearManagedDict` like this:: PyObject_ClearManagedDict((PyObject*)self);