Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions Doc/using/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve performance of list extension by dictionary items.
23 changes: 0 additions & 23 deletions Modules/_tkinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
6 changes: 3 additions & 3 deletions Objects/listobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading