Skip to content

Commit b32bd8f

Browse files
Merge branch 'main' into re-properties
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 parents f9f3931 + a5677bf commit b32bd8f

100 files changed

Lines changed: 4419 additions & 383 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.

.github/workflows/jit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ jobs:
6464
include:
6565
- target: i686-pc-windows-msvc/msvc
6666
architecture: Win32
67-
runner: windows-2025-vs2026
67+
runner: windows-2025
6868
- target: x86_64-pc-windows-msvc/msvc
6969
architecture: x64
70-
runner: windows-2025-vs2026
70+
runner: windows-2025
7171
- target: aarch64-pc-windows-msvc/msvc
7272
architecture: ARM64
7373
runner: windows-11-arm

.github/workflows/reusable-windows-msi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
jobs:
1818
build:
1919
name: installer for ${{ inputs.arch }}
20-
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025-vs2026' }}
20+
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
2121
timeout-minutes: 60
2222
env:
2323
ARCH: ${{ inputs.arch }}

.github/workflows/reusable-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ env:
2626
jobs:
2727
build:
2828
name: Build and test (${{ inputs.arch }}, ${{ inputs.interpreter }})
29-
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025-vs2026' }}
29+
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
3030
timeout-minutes: 60
3131
env:
3232
ARCH: ${{ inputs.arch }}

Doc/extending/extending.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,8 @@ calling the Python callback functions from a C callback. Other uses are also
231231
imaginable.
232232

233233
Fortunately, the Python interpreter is easily called recursively, and there is a
234-
standard interface to call a Python function. (I won't dwell on how to call the
235-
Python parser with a particular string as input --- if you're interested, have a
236-
look at the implementation of the :option:`-c` command line option in
237-
:file:`Modules/main.c` from the Python source code.)
234+
standard interface to call a Python function. (If you're interested in how to call the
235+
Python parser with a particular string as input, see :ref:`veryhigh`.)
238236

239237
Calling a Python function is easy. First, the Python program must somehow pass
240238
you the Python function object. You should provide a function (or some other
@@ -641,7 +639,7 @@ and the object is freed.
641639

642640
An alternative strategy is called :dfn:`automatic garbage collection`.
643641
(Sometimes, reference counting is also referred to as a garbage collection
644-
strategy, hence my use of "automatic" to distinguish the two.) The big
642+
strategy, hence the use of "automatic" to distinguish the two.) The big
645643
advantage of automatic garbage collection is that the user doesn't need to call
646644
:c:func:`free` explicitly. (Another claimed advantage is an improvement in speed
647645
or memory usage --- this is no hard fact however.) The disadvantage is that for

Doc/library/csv.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ The :mod:`!csv` module defines the following functions:
8181
Spam, Spam, Spam, Spam, Spam, Baked Beans
8282
Spam, Lovely Spam, Wonderful Spam
8383

84+
where :file:`eggs.csv` contains:
85+
86+
.. code-block:: text
87+
88+
Spam Spam Spam Spam Spam |Baked Beans|
89+
Spam |Lovely Spam| |Wonderful Spam|
90+
8491
8592
.. function:: writer(csvfile, /, dialect='excel', **fmtparams)
8693

@@ -110,6 +117,13 @@ The :mod:`!csv` module defines the following functions:
110117
spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])
111118
spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
112119

120+
which writes :file:`eggs.csv` containing:
121+
122+
.. code-block:: text
123+
124+
Spam Spam Spam Spam Spam |Baked Beans|
125+
Spam |Lovely Spam| |Wonderful Spam|
126+
113127
114128
.. function:: register_dialect(name, /, dialect='excel', **fmtparams)
115129

@@ -191,6 +205,14 @@ The :mod:`!csv` module defines the following classes:
191205
>>> print(row)
192206
{'first_name': 'John', 'last_name': 'Cleese'}
193207

208+
where :file:`names.csv` contains:
209+
210+
.. code-block:: text
211+
212+
first_name,last_name
213+
Eric,Idle
214+
John,Cleese
215+
194216
195217
.. class:: DictWriter(f, fieldnames, restval='', extrasaction='raise', \
196218
dialect='excel', *args, **kwds)
@@ -228,6 +250,15 @@ The :mod:`!csv` module defines the following classes:
228250
writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})
229251
writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})
230252

253+
which writes :file:`names.csv` containing:
254+
255+
.. code-block:: text
256+
257+
first_name,last_name
258+
Baked,Beans
259+
Lovely,Spam
260+
Wonderful,Spam
261+
231262
232263
.. class:: Dialect
233264

Doc/library/curses.rst

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,16 @@ The module :mod:`!curses` defines the following functions:
194194
the curses library itself.
195195

196196

197+
.. function:: erasewchar()
198+
199+
Return the user's current erase character as a one-character string.
200+
This is the wide-character variant of :func:`erasechar`. Availability
201+
depends on building Python against a wide-character-aware version of the
202+
underlying curses library.
203+
204+
.. versionadded:: next
205+
206+
197207
.. function:: filter()
198208

199209
The :func:`.filter` routine, if used, must be called before :func:`initscr` is
@@ -379,6 +389,16 @@ The module :mod:`!curses` defines the following functions:
379389
by the curses library itself.
380390

381391

392+
.. function:: killwchar()
393+
394+
Return the user's current line kill character as a one-character string.
395+
This is the wide-character variant of :func:`killchar`. Availability
396+
depends on building Python against a wide-character-aware version of the
397+
underlying curses library.
398+
399+
.. versionadded:: next
400+
401+
382402
.. function:: longname()
383403

384404
Return a bytes object containing the terminfo long name field describing the current
@@ -690,6 +710,18 @@ The module :mod:`!curses` defines the following functions:
690710
example as ``b'^C'``. Printing characters are left as they are.
691711

692712

713+
.. function:: wunctrl(ch)
714+
715+
Return a string which is a printable representation of the wide character *ch*.
716+
Control characters are represented as a caret followed by the character, for
717+
example as ``'^C'``. Printing characters are left as they are. This is the
718+
wide-character variant of :func:`unctrl`, returning a :class:`str` rather than
719+
:class:`bytes`. Availability depends on building Python against a
720+
wide-character-aware version of the underlying curses library.
721+
722+
.. versionadded:: next
723+
724+
693725
.. function:: ungetch(ch)
694726

695727
Push *ch* so the next :meth:`~window.getch` will return it.
@@ -770,12 +802,19 @@ Window objects
770802
character previously painted at that location. By default, the character
771803
position and attributes are the current settings for the window object.
772804

805+
*ch* may be a single character, optionally followed by combining
806+
characters, that together occupy one character cell.
807+
773808
.. note::
774809

775810
Writing outside the window, subwindow, or pad raises a :exc:`curses.error`.
776811
Attempting to write to the lower-right corner of a window, subwindow,
777812
or pad will cause an exception to be raised after the character is printed.
778813

814+
.. versionchanged:: next
815+
A character may now be given as a string of a base character followed
816+
by combining characters, instead of only a single character.
817+
779818

780819
.. method:: window.addnstr(str, n[, attr])
781820
window.addnstr(y, x, str, n[, attr])
@@ -834,6 +873,9 @@ Window objects
834873
* Wherever the former background character appears, it is changed to the new
835874
background character.
836875

876+
.. versionchanged:: next
877+
Wide and combining characters are now accepted.
878+
837879

838880
.. method:: window.bkgdset(ch[, attr])
839881

@@ -844,6 +886,9 @@ Window objects
844886
characters. The background becomes a property of the character and moves with
845887
the character through any scrolling and insert/delete line/character operations.
846888

889+
.. versionchanged:: next
890+
Wide and combining characters are now accepted.
891+
847892

848893
.. method:: window.border([ls[, rs[, ts[, bs[, tl[, tr[, bl[, br]]]]]]]])
849894

@@ -877,12 +922,20 @@ Window objects
877922
| *br* | Bottom-right corner | :const:`ACS_LRCORNER` |
878923
+-----------+---------------------+-----------------------+
879924

925+
.. versionchanged:: next
926+
Wide and combining characters are now accepted. A single call cannot mix
927+
them with integer or byte characters.
928+
880929

881930
.. method:: window.box([vertch, horch])
882931

883932
Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* and
884933
*bs* are *horch*. The default corner characters are always used by this function.
885934

935+
.. versionchanged:: next
936+
Wide and combining characters are now accepted. A single call cannot mix
937+
them with integer or byte characters.
938+
886939

887940
.. method:: window.chgat(attr)
888941
window.chgat(num, attr)
@@ -951,6 +1004,9 @@ Window objects
9511004
Add character *ch* with attribute *attr*, and immediately call :meth:`refresh`
9521005
on the window.
9531006

1007+
.. versionchanged:: next
1008+
Wide and combining characters are now accepted.
1009+
9541010

9551011
.. method:: window.enclose(y, x)
9561012

@@ -1038,6 +1094,20 @@ Window objects
10381094
The maximum value for *n* was increased from 1023 to 2047.
10391095

10401096

1097+
.. method:: window.get_wstr()
1098+
window.get_wstr(n)
1099+
window.get_wstr(y, x)
1100+
window.get_wstr(y, x, n)
1101+
1102+
Read a string from the user, with primitive line editing capacity.
1103+
This is the wide-character variant of :meth:`getstr`: it returns a
1104+
:class:`str` rather than a :class:`bytes` object, so it can return
1105+
characters that are not representable in the window's encoding.
1106+
At most *n* characters are read; *n* defaults to and cannot exceed 2047.
1107+
1108+
.. versionadded:: next
1109+
1110+
10411111
.. method:: window.getyx()
10421112

10431113
Return a tuple ``(y, x)`` of current cursor position relative to the window's
@@ -1051,6 +1121,9 @@ Window objects
10511121
the character *ch* with attributes *attr*. The line stops at the right edge
10521122
of the window if fewer than *n* cells are available.
10531123

1124+
.. versionchanged:: next
1125+
Wide and combining characters are now accepted.
1126+
10541127

10551128
.. method:: window.idcok(flag)
10561129

@@ -1088,6 +1161,9 @@ Window objects
10881161
cursor are shifted one position right, with the rightmost character on the
10891162
line being lost. The cursor position does not change.
10901163

1164+
.. versionchanged:: next
1165+
Wide and combining characters are now accepted.
1166+
10911167

10921168
.. method:: window.insdelln(nlines)
10931169

@@ -1137,6 +1213,19 @@ Window objects
11371213
The maximum value for *n* was increased from 1023 to 2047.
11381214

11391215

1216+
.. method:: window.in_wstr([n])
1217+
window.in_wstr(y, x[, n])
1218+
1219+
Return a string of characters, extracted from the window starting at the
1220+
current cursor position, or at *y*, *x* if specified. This is the
1221+
wide-character variant of :meth:`instr`: it returns a :class:`str` rather
1222+
than a :class:`bytes` object, so it can return characters that are not
1223+
representable in the window's encoding. Attributes and color information
1224+
are stripped from the characters. The maximum value for *n* is 2047.
1225+
1226+
.. versionadded:: next
1227+
1228+
11401229
.. method:: window.is_linetouched(line)
11411230

11421231
Return ``True`` if the specified line was modified since the last call to
@@ -1386,6 +1475,9 @@ Window objects
13861475
Display a vertical line starting at ``(y, x)`` with length *n* consisting of the
13871476
character *ch* with attributes *attr*.
13881477

1478+
.. versionchanged:: next
1479+
Wide and combining characters are now accepted.
1480+
13891481

13901482
Constants
13911483
---------

Doc/library/dialog.rst

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ The :mod:`!tkinter.simpledialog` module contains convenience classes and
1515
functions for creating simple modal dialogs to get a value from the user.
1616

1717

18-
.. function:: askfloat(title, prompt, *, initialvalue=None, minvalue=None, maxvalue=None, parent=None)
19-
askinteger(title, prompt, *, initialvalue=None, minvalue=None, maxvalue=None, parent=None)
20-
askstring(title, prompt, *, initialvalue=None, show=None, parent=None)
18+
.. function:: askfloat(title, prompt, *, initialvalue=None, minvalue=None, maxvalue=None, parent=None, use_ttk=True)
19+
askinteger(title, prompt, *, initialvalue=None, minvalue=None, maxvalue=None, parent=None, use_ttk=True)
20+
askstring(title, prompt, *, initialvalue=None, show=None, parent=None, use_ttk=True)
2121
2222
Prompt the user to enter a value of the desired type and return it, or
2323
``None`` if the dialog is cancelled.
@@ -29,12 +29,22 @@ functions for creating simple modal dialogs to get a value from the user.
2929
*maxvalue*, which bound the accepted value.
3030
:func:`askstring` also accepts *show*, a character used to mask the entered
3131
text, for example ``'*'`` to hide a password.
32+
They use the themed :mod:`tkinter.ttk` widgets; pass ``use_ttk=False`` for
33+
the classic widgets.
3234

33-
.. class:: Dialog(parent, title=None)
35+
.. class:: Dialog(parent, title=None, *, use_ttk=False)
3436

3537
The base class for custom dialogs.
3638
Instantiating it shows the dialog modally and returns once the user closes
3739
it; the entered value is then available in the :attr:`!result` attribute.
40+
When *use_ttk* is false (the default), the dialog is built from the classic
41+
:mod:`tkinter` widgets, modelled on the classic ``tk_dialog``; when true,
42+
from the themed :mod:`tkinter.ttk` widgets, modelled on the Tk message box.
43+
The default is classic for compatibility, since the themed widgets set a
44+
themed background that classic widgets added in :meth:`body` would not match.
45+
46+
.. versionchanged:: next
47+
Added the *use_ttk* parameter.
3848

3949
.. attribute:: result
4050

@@ -74,14 +84,32 @@ functions for creating simple modal dialogs to get a value from the user.
7484
the initial focus.
7585

7686

77-
.. class:: SimpleDialog(master, text='', buttons=[], default=None, cancel=None, title=None, class_=None)
87+
.. class:: SimpleDialog(master, text='', buttons=[], default=None, cancel=None, title=None, class_=None, *, bitmap=None, detail='', use_ttk=True)
7888

7989
A simple modal dialog that displays the message *text* above a row of push
80-
buttons whose labels are given by *buttons*, and returns the index of the
81-
button the user presses.
82-
*default* is the index of the button activated by the Return key, *cancel*
83-
the index returned when the window is closed through the window manager,
84-
*title* the window title, and *class_* the Tk class name of the window.
90+
buttons given by *buttons*, and returns the index of the button the user
91+
presses.
92+
Each entry of *buttons* is either a button label, or a mapping of button
93+
options such as ``{'text': 'OK', 'underline': 0}``; an ``underline`` option
94+
makes :kbd:`Alt` plus the underlined character invoke the button.
95+
*default* is the index of the default button, activated by the Return key
96+
when no button has the focus, *cancel* the index returned when the window is
97+
closed through the window manager, *title* the window title, and *class_*
98+
the Tk class name of the window.
99+
*bitmap* is the name of a bitmap displayed beside the message
100+
(for example ``'warning'`` or ``'question'``); the standard names
101+
``'error'``, ``'info'``, ``'question'`` and ``'warning'`` are shown as
102+
themed icons when *use_ttk* is true.
103+
*detail* is a secondary message displayed below *text*.
104+
When *use_ttk* is true (the default), the dialog is built from the themed
105+
:mod:`tkinter.ttk` widgets, modelled on the Tk message box; when false, from
106+
the classic :mod:`tkinter` widgets, modelled on ``tk_dialog``.
107+
108+
.. versionchanged:: next
109+
The dialog is now built from the themed :mod:`tkinter.ttk` widgets by
110+
default, instead of the classic :mod:`tkinter` widgets.
111+
Added the *bitmap*, *detail* and *use_ttk* parameters.
112+
Entries of *buttons* may be mappings of button options.
85113

86114
.. method:: go()
87115

Doc/library/queue.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ provide the public methods described below.
173173

174174
.. method:: Queue.get_nowait()
175175

176-
Equivalent to ``get(False)``.
176+
Equivalent to ``get(block=False)``.
177177

178178
Two methods are offered to support tracking whether enqueued tasks have been
179179
fully processed by daemon consumer threads.

0 commit comments

Comments
 (0)