Skip to content

Commit c41c3a8

Browse files
authored
Merge branch 'main' into gh-152068-pyrepl-color-bug
2 parents 3d363f1 + 7676427 commit c41c3a8

52 files changed

Lines changed: 2178 additions & 778 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@
6363
.azure-pipelines/ @AA-Turner
6464

6565
# GitHub & related scripts
66-
.github/ @ezio-melotti @hugovk @AA-Turner @webknjaz @itamaro
66+
.github/ @ezio-melotti @hugovk @AA-Turner @webknjaz @itamaro @JacobCoffee
6767
Tools/build/compute-changes.py @AA-Turner @hugovk @webknjaz
6868
Lib/test/test_tools/test_compute_changes.py @AA-Turner @hugovk @webknjaz
6969
Tools/build/verify_ensurepip_wheels.py @AA-Turner @pfmoore @pradyunsg
7070

7171
# Pre-commit
72-
.pre-commit-config.yaml @hugovk
73-
.ruff.toml @hugovk @AlexWaygood @AA-Turner
72+
.pre-commit-config.yaml @hugovk @JacobCoffee
73+
.ruff.toml @hugovk @AlexWaygood @AA-Turner @JacobCoffee
7474

7575
# Patchcheck
7676
Tools/patchcheck/ @AA-Turner @itamaro

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,9 @@ jobs:
601601
run: ./configure --prefix="$BUILD_DIR/cross-python" --with-build-python="$BUILD_DIR/host-python/bin/python3"
602602
- name: Install cross Python
603603
run: make -j8 install
604+
- name: Display build info
605+
run: |
606+
"$BUILD_DIR/cross-python/bin/python3" -m test.pythoninfo
604607
- name: Run test subset with host build
605608
run: |
606609
"$BUILD_DIR/cross-python/bin/python3" -m test test_sysconfig test_site test_embed

.github/workflows/reusable-emscripten.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,17 @@ jobs:
6363
run: python3 Platforms/emscripten configure-build-python -- --config-cache --with-pydebug
6464
- name: "Make build Python"
6565
run: python3 Platforms/emscripten make-build-python
66+
- name: "Display build info of the build Python"
67+
run: python3 Platforms/emscripten pythoninfo-build
6668
- name: "Make dependencies"
6769
run: >-
6870
python3 Platforms/emscripten make-dependencies
6971
${{ steps.emsdk-cache.outputs.cache-hit == 'true' && '--check-up-to-date' || '' }}
70-
- name: "Configure host Python"
72+
- name: "Configure host/Emscripten Python"
7173
run: python3 Platforms/emscripten configure-host --host-runner node -- --config-cache
72-
- name: "Make host Python"
74+
- name: "Make host/Emscripten Python"
7375
run: python3 Platforms/emscripten make-host
74-
- name: "Display build info"
75-
run: python3 Platforms/emscripten run --pythoninfo
76+
- name: "Display build info of the host/Emscripten Python"
77+
run: python3 Platforms/emscripten pythoninfo-host
7678
- name: "Test"
7779
run: python3 Platforms/emscripten run --test

Doc/deprecations/pending-removal-in-3.17.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,13 @@ Pending removal in Python 3.17
6868

6969
See :pep:`PEP 688 <688#current-options>` for more details.
7070
(Contributed by Shantanu Jain in :gh:`91896`.)
71+
72+
* :mod:`tkinter`:
73+
74+
- The :class:`!tkinter.Variable` methods :meth:`!trace_variable`,
75+
:meth:`!trace` (an alias of :meth:`!trace_variable`),
76+
:meth:`!trace_vdelete` and :meth:`!trace_vinfo`, deprecated since
77+
Python 3.14, are scheduled for removal in Python 3.17.
78+
Use :meth:`!trace_add`, :meth:`!trace_remove` and :meth:`!trace_info`
79+
instead.
80+
(Contributed by Serhiy Storchaka in :gh:`120220`.)

Doc/library/curses.rst

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,20 @@ The module :mod:`!curses` defines the following functions:
8585
.. versionadded:: 3.14
8686

8787

88+
.. function:: alloc_pair(fg, bg)
89+
90+
Allocate a color pair for foreground color *fg* and background color *bg*,
91+
and return its number. If a color pair for the same combination of colors
92+
already exists, return its number. Otherwise allocate a new color pair and
93+
return its number.
94+
95+
This function is only available if Python was built against a wide-character
96+
version of the underlying curses library with extended-color support (see
97+
:func:`has_extended_color_support`).
98+
99+
.. versionadded:: next
100+
101+
88102
.. function:: baudrate()
89103

90104
Return the output speed of the terminal in bits per second. On software
@@ -226,6 +240,19 @@ The module :mod:`!curses` defines the following functions:
226240
.. versionadded:: next
227241

228242

243+
.. function:: find_pair(fg, bg)
244+
245+
Return the number of a color pair for foreground color *fg* and background
246+
color *bg*, or ``-1`` if no color pair for this combination of colors has
247+
been allocated.
248+
249+
This function is only available if Python was built against a wide-character
250+
version of the underlying curses library with extended-color support (see
251+
:func:`has_extended_color_support`).
252+
253+
.. versionadded:: next
254+
255+
229256
.. function:: flash()
230257

231258
Flash the screen. That is, change it to reverse-video and then change it back
@@ -239,6 +266,18 @@ The module :mod:`!curses` defines the following functions:
239266
by the user and has not yet been processed by the program.
240267

241268

269+
.. function:: free_pair(pair_number)
270+
271+
Free the color pair *pair_number*, which must have been allocated by
272+
:func:`alloc_pair`. The pair must not be in use.
273+
274+
This function is only available if Python was built against a wide-character
275+
version of the underlying curses library with extended-color support (see
276+
:func:`has_extended_color_support`).
277+
278+
.. versionadded:: next
279+
280+
242281
.. function:: getmouse()
243282

244283
After :meth:`~window.getch` returns :const:`KEY_MOUSE` to signal a mouse event, this
@@ -359,6 +398,41 @@ The module :mod:`!curses` defines the following functions:
359398
no flushing is done.
360399

361400

401+
.. function:: is_cbreak()
402+
403+
Return ``True`` if cbreak mode (see :func:`cbreak`) is enabled,
404+
``False`` otherwise.
405+
Availability: ncurses 6.5 or later.
406+
407+
.. versionadded:: next
408+
409+
410+
.. function:: is_echo()
411+
412+
Return ``True`` if echo mode (see :func:`echo`) is enabled,
413+
``False`` otherwise.
414+
Availability: ncurses 6.5 or later.
415+
416+
.. versionadded:: next
417+
418+
419+
.. function:: is_nl()
420+
421+
Return ``True`` if nl mode (see :func:`nl`) is enabled, ``False`` otherwise.
422+
Availability: ncurses 6.5 or later.
423+
424+
.. versionadded:: next
425+
426+
427+
.. function:: is_raw()
428+
429+
Return ``True`` if raw mode (see :func:`raw`) is enabled,
430+
``False`` otherwise.
431+
Availability: ncurses 6.5 or later.
432+
433+
.. versionadded:: next
434+
435+
362436
.. function:: is_term_resized(nlines, ncols)
363437

364438
Return ``True`` if :func:`resize_term` would modify the window structure,
@@ -570,6 +644,18 @@ The module :mod:`!curses` defines the following functions:
570644
presented to curses input functions one by one.
571645

572646

647+
.. function:: reset_color_pairs()
648+
649+
Discard all color-pair definitions, releasing the color pairs allocated by
650+
:func:`init_pair` and :func:`alloc_pair`.
651+
652+
This function is only available if Python was built against a wide-character
653+
version of the underlying curses library with extended-color support (see
654+
:func:`has_extended_color_support`).
655+
656+
.. versionadded:: next
657+
658+
573659
.. function:: reset_prog_mode()
574660

575661
Restore the terminal to "program" mode, as previously saved by
@@ -1103,6 +1189,16 @@ Window objects
11031189
.. versionadded:: 3.3
11041190

11051191

1192+
.. method:: window.getdelay()
1193+
1194+
Return the window's read timeout in milliseconds,
1195+
as set by :meth:`nodelay` or :meth:`timeout`:
1196+
``-1`` for blocking, ``0`` for non-blocking,
1197+
or a positive number of milliseconds.
1198+
1199+
.. versionadded:: next
1200+
1201+
11061202
.. method:: window.getkey([y, x])
11071203

11081204
Get a character, returning a string instead of an integer, as :meth:`getch`
@@ -1116,13 +1212,29 @@ Window objects
11161212
Return a tuple ``(y, x)`` of the height and width of the window.
11171213

11181214

1215+
.. method:: window.getparent()
1216+
1217+
Return the parent window of this subwindow,
1218+
or ``None`` if this window is not a subwindow.
1219+
1220+
.. versionadded:: next
1221+
1222+
11191223
.. method:: window.getparyx()
11201224

11211225
Return the beginning coordinates of this window relative to its parent window
11221226
as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no
11231227
parent.
11241228

11251229

1230+
.. method:: window.getscrreg()
1231+
1232+
Return a tuple ``(top, bottom)`` of the window's current scrolling region,
1233+
as set by :meth:`setscrreg`.
1234+
1235+
.. versionadded:: next
1236+
1237+
11261238
.. method:: window.getstr()
11271239
window.getstr(n)
11281240
window.getstr(y, x)
@@ -1268,13 +1380,98 @@ Window objects
12681380
.. versionadded:: next
12691381

12701382

1383+
.. method:: window.is_cleared()
1384+
1385+
Return the current value set by :meth:`clearok`.
1386+
1387+
.. versionadded:: next
1388+
1389+
1390+
.. method:: window.is_idcok()
1391+
1392+
Return the current value set by :meth:`idcok`.
1393+
1394+
.. versionadded:: next
1395+
1396+
1397+
.. method:: window.is_idlok()
1398+
1399+
Return the current value set by :meth:`idlok`.
1400+
1401+
.. versionadded:: next
1402+
1403+
1404+
.. method:: window.is_immedok()
1405+
1406+
Return the current value set by :meth:`immedok`.
1407+
1408+
.. versionadded:: next
1409+
1410+
1411+
.. method:: window.is_keypad()
1412+
1413+
Return the current value set by :meth:`keypad`.
1414+
1415+
.. versionadded:: next
1416+
1417+
1418+
.. method:: window.is_leaveok()
1419+
1420+
Return the current value set by :meth:`leaveok`.
1421+
1422+
.. versionadded:: next
1423+
1424+
12711425
.. method:: window.is_linetouched(line)
12721426

12731427
Return ``True`` if the specified line was modified since the last call to
12741428
:meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error`
12751429
exception if *line* is not valid for the given window.
12761430

12771431

1432+
.. method:: window.is_nodelay()
1433+
1434+
Return the current value set by :meth:`nodelay`.
1435+
1436+
.. versionadded:: next
1437+
1438+
1439+
.. method:: window.is_notimeout()
1440+
1441+
Return the current value set by :meth:`notimeout`.
1442+
1443+
.. versionadded:: next
1444+
1445+
1446+
.. method:: window.is_pad()
1447+
1448+
Return ``True`` if the window is a pad created by :func:`newpad`.
1449+
1450+
.. versionadded:: next
1451+
1452+
1453+
.. method:: window.is_scrollok()
1454+
1455+
Return the current value set by :meth:`scrollok`.
1456+
1457+
.. versionadded:: next
1458+
1459+
1460+
.. method:: window.is_subwin()
1461+
1462+
Return ``True`` if the window is a subwindow created by :meth:`subwin`
1463+
or :meth:`derwin`.
1464+
1465+
.. versionadded:: next
1466+
1467+
1468+
.. method:: window.is_syncok()
1469+
1470+
Return the current value set by :meth:`syncok`.
1471+
1472+
.. versionadded:: next
1473+
1474+
12781475
.. method:: window.is_wintouched()
12791476

12801477
Return ``True`` if the specified window was modified since the last call to

Doc/library/re.rst

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -279,25 +279,47 @@ The special characters are:
279279
``[]()[{}]`` will match a right bracket, as well as left bracket, braces,
280280
and parentheses.
281281

282-
.. .. index:: single: --; in regular expressions
283-
.. .. index:: single: &&; in regular expressions
284-
.. .. index:: single: ~~; in regular expressions
285-
.. .. index:: single: ||; in regular expressions
286-
287-
* Support of nested sets and set operations as in `Unicode Technical
288-
Standard #18`_ might be added in the future. This would change the
289-
syntax, so to facilitate this change a :exc:`FutureWarning` will be raised
290-
in ambiguous cases for the time being.
291-
That includes sets starting with a literal ``'['`` or containing literal
292-
character sequences ``'--'``, ``'&&'``, ``'~~'``, and ``'||'``. To
293-
avoid a warning escape them with a backslash.
282+
.. index::
283+
single: --; in regular expressions
284+
single: &&; in regular expressions
285+
single: ||; in regular expressions
286+
287+
* A character set may contain a nested set written in square brackets, and
288+
two sets may be combined with a set operator, as in `Unicode Technical
289+
Standard #18`_:
290+
291+
* ``[A--B]`` (*difference*) matches a character that is in *A* but not
292+
in *B*; for example ``[a-z--[aeiou]]`` matches an ASCII lowercase
293+
consonant.
294+
* ``[A&&B]`` (*intersection*) matches a character that is in both *A*
295+
and *B*; for example ``[\w&&[a-z]]`` matches an ASCII lowercase letter.
296+
* ``[A||B]`` (*union*) matches a character that is in *A* or in *B*; this
297+
is the same as listing the members of both sets in a single set, but
298+
allows combining nested sets.
299+
300+
Operators have no precedence and are applied from left to right. To
301+
group, write a nested set as the operand after an operator, as in
302+
``[a-z--[aeiou]]``. A leading ``'^'`` complements the whole result.
303+
A ``'['`` begins a nested set only immediately after a set operator;
304+
anywhere else -- including at the start of a character set -- it is an
305+
ordinary character, so existing patterns keep their meaning. Escape it
306+
as ``'\['`` to include a literal ``'['`` right after an operator.
294307

295308
.. _Unicode Technical Standard #18: https://unicode.org/reports/tr18/
296309

310+
.. note::
311+
312+
Symmetric difference (``A~~B``) is not yet supported; a literal ``'~~'``
313+
in a character set still raises a :exc:`FutureWarning`.
314+
297315
.. versionchanged:: 3.7
298316
:exc:`FutureWarning` is raised if a character set contains constructs
299317
that will change semantically in the future.
300318

319+
.. versionchanged:: next
320+
Added support for nested sets and the set operators ``--``, ``&&``
321+
and ``||``.
322+
301323
.. index:: single: | (vertical bar); in regular expressions
302324

303325
``|``

0 commit comments

Comments
 (0)