Skip to content

Commit 9c7b17b

Browse files
Merge branch 'main' into issue-139817-type-alias-qualname
2 parents 730436a + be60e4b commit 9c7b17b

28 files changed

+471
-222
lines changed

Doc/c-api/object.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ Object Protocol
600600
601601
Clear the managed dictionary of *obj*.
602602
603-
This function must only be called in a traverse function of the type which
603+
This function must only be called in a clear function of the type which
604604
has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set.
605605
606606
.. versionadded:: 3.13

Doc/c-api/typeobj.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
17041704
:c:func:`Py_CLEAR` macro performs the operations in a safe order.
17051705

17061706
If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the
1707-
:c:member:`~PyTypeObject.tp_flags` field, the traverse function must call
1707+
:c:member:`~PyTypeObject.tp_flags` field, the clear function must call
17081708
:c:func:`PyObject_ClearManagedDict` like this::
17091709

17101710
PyObject_ClearManagedDict((PyObject*)self);

Doc/library/pprint.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ The formatted representation keeps objects on a single line if it can, and
2222
breaks them onto multiple lines if they don't fit within the allowed width,
2323
adjustable by the *width* parameter defaulting to 80 characters.
2424

25-
Dictionaries are sorted by key before the display is computed.
26-
2725
.. versionchanged:: 3.9
2826
Added support for pretty-printing :class:`types.SimpleNamespace`.
2927

Doc/library/turtle.rst

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -777,13 +777,17 @@ Turtle motion
777777
180.0
778778

779779

780-
.. function:: dot(size=None, *color)
780+
.. function:: dot()
781+
dot(size)
782+
dot(color, /)
783+
dot(size, color, /)
784+
dot(size, r, g, b, /)
781785

782786
:param size: an integer >= 1 (if given)
783787
:param color: a colorstring or a numeric color tuple
784788

785789
Draw a circular dot with diameter *size*, using *color*. If *size* is
786-
not given, the maximum of pensize+4 and 2*pensize is used.
790+
not given, the maximum of ``pensize+4`` and ``2*pensize`` is used.
787791

788792

789793
.. doctest::
@@ -1152,7 +1156,9 @@ Drawing state
11521156
Color control
11531157
~~~~~~~~~~~~~
11541158

1155-
.. function:: pencolor(*args)
1159+
.. function:: pencolor()
1160+
pencolor(color, /)
1161+
pencolor(r, g, b, /)
11561162

11571163
Return or set the pencolor.
11581164

@@ -1161,7 +1167,7 @@ Color control
11611167
``pencolor()``
11621168
Return the current pencolor as color specification string or
11631169
as a tuple (see example). May be used as input to another
1164-
color/pencolor/fillcolor call.
1170+
color/pencolor/fillcolor/bgcolor call.
11651171

11661172
``pencolor(colorstring)``
11671173
Set pencolor to *colorstring*, which is a Tk color specification string,
@@ -1201,7 +1207,9 @@ Color control
12011207
(50.0, 193.0, 143.0)
12021208

12031209

1204-
.. function:: fillcolor(*args)
1210+
.. function:: fillcolor()
1211+
fillcolor(color, /)
1212+
fillcolor(r, g, b, /)
12051213

12061214
Return or set the fillcolor.
12071215

@@ -1210,7 +1218,7 @@ Color control
12101218
``fillcolor()``
12111219
Return the current fillcolor as color specification string, possibly
12121220
in tuple format (see example). May be used as input to another
1213-
color/pencolor/fillcolor call.
1221+
color/pencolor/fillcolor/bgcolor call.
12141222

12151223
``fillcolor(colorstring)``
12161224
Set fillcolor to *colorstring*, which is a Tk color specification string,
@@ -1244,7 +1252,10 @@ Color control
12441252
(255.0, 255.0, 255.0)
12451253

12461254

1247-
.. function:: color(*args)
1255+
.. function:: color()
1256+
color(color, /)
1257+
color(r, g, b, /)
1258+
color(pencolor, fillcolor, /)
12481259

12491260
Return or set pencolor and fillcolor.
12501261

@@ -1870,13 +1881,32 @@ Most of the examples in this section refer to a TurtleScreen instance called
18701881
Window control
18711882
--------------
18721883

1873-
.. function:: bgcolor(*args)
1884+
.. function:: bgcolor()
1885+
bgcolor(color, /)
1886+
bgcolor(r, g, b, /)
18741887

1875-
:param args: a color string or three numbers in the range 0..colormode or a
1876-
3-tuple of such numbers
1888+
Return or set the background color of the TurtleScreen.
18771889

1890+
Four input formats are allowed:
1891+
1892+
``bgcolor()``
1893+
Return the current background color as color specification string or
1894+
as a tuple (see example). May be used as input to another
1895+
color/pencolor/fillcolor/bgcolor call.
1896+
1897+
``bgcolor(colorstring)``
1898+
Set the background color to *colorstring*, which is a Tk color
1899+
specification string, such as ``"red"``, ``"yellow"``, or ``"#33cc8c"``.
18781900

1879-
Set or return background color of the TurtleScreen.
1901+
``bgcolor((r, g, b))``
1902+
Set the background color to the RGB color represented by the tuple of
1903+
*r*, *g*, and *b*.
1904+
Each of *r*, *g*, and *b* must be in the range 0..colormode, where
1905+
colormode is either 1.0 or 255 (see :func:`colormode`).
1906+
1907+
``bgcolor(r, g, b)``
1908+
Set the background color to the RGB color represented by *r*, *g*, and *b*. Each of
1909+
*r*, *g*, and *b* must be in the range 0..colormode.
18801910

18811911
.. doctest::
18821912
:skipif: _tkinter is None

Doc/using/cmdline.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,9 +1277,8 @@ conflict.
12771277
.. envvar:: PYTHON_BASIC_REPL
12781278

12791279
If this variable is set to any value, the interpreter will not attempt to
1280-
load the Python-based :term:`REPL` that requires :mod:`curses` and
1281-
:mod:`readline`, and will instead use the traditional parser-based
1282-
:term:`REPL`.
1280+
load the Python-based :term:`REPL` that requires :mod:`readline`, and will
1281+
instead use the traditional parser-based :term:`REPL`.
12831282

12841283
.. versionadded:: 3.13
12851284

Doc/using/windows.rst

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ packages.
6060
.. _windows-path-mod:
6161
.. _launcher:
6262

63-
Python Install Manager
63+
Python install manager
6464
======================
6565

6666
Installation
@@ -103,7 +103,7 @@ Windows Server 2019, please see :ref:`pymanager-advancedinstall` below for more
103103
information.
104104

105105

106-
Basic Use
106+
Basic use
107107
---------
108108

109109
The recommended command for launching Python is ``python``, which will either
@@ -193,7 +193,7 @@ installed if automatic installation is configured (most likely by setting
193193
``pymanager exec`` forms of the command were used.
194194

195195

196-
Command Help
196+
Command help
197197
------------
198198

199199
The ``py help`` command will display the full list of supported commands, along
@@ -218,7 +218,7 @@ override multiple settings at once. See :ref:`pymanager-config` below for more
218218
information about these files.
219219

220220

221-
Listing Runtimes
221+
Listing runtimes
222222
----------------
223223

224224
.. code::
@@ -259,7 +259,7 @@ For compatibility with the old launcher, the ``--list``, ``--list-paths``,
259259
additional options, and will produce legacy formatted output.
260260

261261

262-
Installing Runtimes
262+
Installing runtimes
263263
-------------------
264264

265265
.. code::
@@ -298,7 +298,7 @@ useful for embedding runtimes into larger applications.
298298
299299
.. _pymanager-offline:
300300

301-
Offline Installs
301+
Offline installs
302302
----------------
303303

304304
To perform offline installs of Python, you will need to first create an offline
@@ -330,7 +330,7 @@ In this way, Python runtimes can be installed and managed on a machine without
330330
access to the internet.
331331

332332

333-
Uninstalling Runtimes
333+
Uninstalling runtimes
334334
---------------------
335335

336336
.. code::
@@ -541,7 +541,7 @@ configuration option.
541541

542542
.. _pymanager-advancedinstall:
543543

544-
Advanced Installation
544+
Advanced installation
545545
---------------------
546546

547547
For situations where an MSIX cannot be installed, such as some older
@@ -635,7 +635,7 @@ the Store package in this way.
635635

636636
.. _pymanager-admin-config:
637637

638-
Administrative Configuration
638+
Administrative configuration
639639
----------------------------
640640

641641
There are a number of options that may be useful for administrators to override
@@ -726,17 +726,12 @@ directory containing the configuration file that specified them.
726726

727727
.. _install-freethreaded-windows:
728728

729-
Installing Free-threaded Binaries
729+
Installing free-threaded binaries
730730
---------------------------------
731731

732-
.. versionadded:: 3.13 (Experimental)
732+
.. versionadded:: 3.13
733733

734-
.. note::
735-
736-
Everything described in this section is considered experimental,
737-
and should be expected to change in future releases.
738-
739-
Pre-built distributions of the experimental free-threaded build are available
734+
Pre-built distributions of the free-threaded build are available
740735
by installing tags with the ``t`` suffix.
741736

742737
.. code::
@@ -885,7 +880,7 @@ versions before providing updates to users.
885880

886881
The two recommended use cases for this distribution are described below.
887882

888-
Python Application
883+
Python application
889884
------------------
890885

891886
An application written in Python does not necessarily require users to be aware
@@ -989,12 +984,7 @@ for the 64-bit version, `www.nuget.org/packages/pythonx86
989984
Free-threaded packages
990985
----------------------
991986

992-
.. versionadded:: 3.13 (Experimental)
993-
994-
.. note::
995-
996-
Everything described in this section is considered experimental,
997-
and should be expected to change in future releases.
987+
.. versionadded:: 3.13
998988

999989
Packages containing free-threaded binaries are named
1000990
`python-freethreaded <https://www.nuget.org/packages/python-freethreaded>`_
@@ -1046,7 +1036,7 @@ please install Python 3.12.
10461036

10471037
.. _max-path:
10481038

1049-
Removing the MAX_PATH Limitation
1039+
Removing the MAX_PATH limitation
10501040
================================
10511041

10521042
Windows historically has limited path lengths to 260 characters. This meant that
@@ -1332,7 +1322,7 @@ installation". In this case:
13321322
* Shortcuts are available for all users
13331323

13341324

1335-
Removing the MAX_PATH Limitation
1325+
Removing the MAX_PATH limitation
13361326
--------------------------------
13371327

13381328
Windows historically has limited path lengths to 260 characters. This meant that
@@ -1355,7 +1345,7 @@ After changing the above option, no further configuration is required.
13551345

13561346
.. _install-quiet-option:
13571347

1358-
Installing Without UI
1348+
Installing without UI
13591349
---------------------
13601350

13611351
All of the options available in the installer UI can also be specified from the
@@ -1504,7 +1494,7 @@ example file sets the same options as the previous example:
15041494
15051495
.. _install-layout-option:
15061496

1507-
Installing Without Downloading
1497+
Installing without downloading
15081498
------------------------------
15091499

15101500
As some features of Python are not included in the initial installer download,
@@ -1545,15 +1535,10 @@ settings and replace any that have been removed or modified.
15451535
:ref:`launcher`, which has its own entry in Programs and Features.
15461536

15471537

1548-
Installing Free-threaded Binaries
1538+
Installing free-threaded binaries
15491539
---------------------------------
15501540

1551-
.. versionadded:: 3.13 (Experimental)
1552-
1553-
.. note::
1554-
1555-
Everything described in this section is considered experimental,
1556-
and should be expected to change in future releases.
1541+
.. versionadded:: 3.13
15571542

15581543
To install pre-built binaries with free-threading enabled (see :pep:`703`), you
15591544
should select "Customize installation". The second page of options includes the
@@ -1585,7 +1570,7 @@ builds.
15851570
Free-threaded binaries are also available :ref:`on nuget.org <windows-nuget>`.
15861571

15871572

1588-
Python Launcher for Windows (Deprecated)
1573+
Python launcher for Windows (deprecated)
15891574
========================================
15901575

15911576
.. deprecated:: 3.14
@@ -1737,7 +1722,7 @@ have the script specify the version which should be used.
17371722
The key benefit of this is that a single launcher can support multiple Python
17381723
versions at the same time depending on the contents of the first line.
17391724

1740-
Shebang Lines
1725+
Shebang lines
17411726
-------------
17421727

17431728
If the first line of a script file starts with ``#!``, it is known as a
@@ -1949,7 +1934,7 @@ should allow you to see what versions of Python were located, why a
19491934
particular version was chosen and the exact command-line used to execute the
19501935
target Python. It is primarily intended for testing and debugging.
19511936

1952-
Dry Run
1937+
Dry run
19531938
-------
19541939

19551940
If an environment variable :envvar:`!PYLAUNCHER_DRYRUN` is set (to any value),

Include/cpython/object.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ PyAPI_FUNC(int) _Py_ReachedRecursionLimitWithMargin(PyThreadState *tstate, int m
442442
PyAPI_FUNC(void *) PyObject_GetItemData(PyObject *obj);
443443

444444
PyAPI_FUNC(int) PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg);
445-
PyAPI_FUNC(int) _PyObject_SetManagedDict(PyObject *obj, PyObject *new_dict);
446445
PyAPI_FUNC(void) PyObject_ClearManagedDict(PyObject *obj);
447446

448447

Include/internal/pycore_dict.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ PyAPI_FUNC(int) _PyDict_SetItem_KnownHash(PyObject *mp, PyObject *key,
3030
// Export for '_asyncio' shared extension
3131
PyAPI_FUNC(int) _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key,
3232
Py_hash_t hash);
33+
34+
extern int _PyDict_DelItem_KnownHash_LockHeld(PyObject *mp, PyObject *key,
35+
Py_hash_t hash);
36+
3337
extern int _PyDict_Contains_KnownHash(PyObject *, PyObject *, Py_hash_t);
3438

3539
// "Id" variants
@@ -47,6 +51,8 @@ extern int _PyDict_HasOnlyStringKeys(PyObject *mp);
4751
// Export for '_ctypes' shared extension
4852
PyAPI_FUNC(Py_ssize_t) _PyDict_SizeOf(PyDictObject *);
4953

54+
extern Py_ssize_t _PyDict_SizeOf_LockHeld(PyDictObject *);
55+
5056
#define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL)
5157

5258
/* Like PyDict_Merge, but override can be 0, 1 or 2. If override is 0,

Include/internal/pycore_object.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,8 @@ enum _PyAnnotateFormat {
10311031
_Py_ANNOTATE_FORMAT_STRING = 4,
10321032
};
10331033

1034-
int _PyObject_SetDict(PyObject *obj, PyObject *value);
1034+
extern int _PyObject_SetDict(PyObject *obj, PyObject *value);
1035+
extern int _PyObject_SetManagedDict(PyObject *obj, PyObject *new_dict);
10351036

10361037
#ifndef Py_GIL_DISABLED
10371038
static inline Py_ALWAYS_INLINE void _Py_INCREF_MORTAL(PyObject *op)

0 commit comments

Comments
 (0)