Skip to content

Commit 72c5bcd

Browse files
authored
Merge branch 'main' into issue-105895-help
2 parents 0f2e231 + a52f428 commit 72c5bcd

31 files changed

Lines changed: 1234 additions & 235 deletions

.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

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/dis.rst

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ code.
139139

140140
.. class:: Bytecode(x, *, first_line=None, current_offset=None,\
141141
show_caches=False, adaptive=False, show_offsets=False,\
142-
show_positions=False)
142+
show_positions=False, show_jit=False)
143143

144144
Analyse the bytecode corresponding to a function, generator, asynchronous
145145
generator, coroutine, method, string of source code, or a code object (as
@@ -170,6 +170,9 @@ code.
170170
If *show_positions* is ``True``, :meth:`.dis` will include instruction
171171
source code positions in the output.
172172

173+
If *show_jit* is ``True``, :meth:`.dis` will show ``ENTER_EXECUTOR``
174+
instructions, which mark JIT entry points and are hidden by default.
175+
173176
.. classmethod:: from_traceback(tb, *, show_caches=False)
174177

175178
Construct a :class:`Bytecode` instance from the given traceback, setting
@@ -205,6 +208,9 @@ code.
205208
.. versionchanged:: 3.14
206209
Added the *show_positions* parameter.
207210

211+
.. versionchanged:: next
212+
Added the *show_jit* parameter.
213+
208214
Example:
209215

210216
.. doctest::
@@ -259,7 +265,8 @@ operation is being performed, so the intermediate analysis object isn't useful:
259265

260266

261267
.. function:: dis(x=None, *, file=None, depth=None, show_caches=False,\
262-
adaptive=False, show_offsets=False, show_positions=False)
268+
adaptive=False, show_offsets=False, show_positions=False,\
269+
show_jit=False)
263270

264271
Disassemble the *x* object. *x* can denote either a module, a class, a
265272
method, a function, a generator, an asynchronous generator, a coroutine,
@@ -286,6 +293,9 @@ operation is being performed, so the intermediate analysis object isn't useful:
286293
If *adaptive* is ``True``, this function will display specialized bytecode
287294
that may be different from the original bytecode.
288295

296+
If *show_jit* is ``True``, this function will show ``ENTER_EXECUTOR``
297+
instructions, which mark JIT entry points and are hidden by default.
298+
289299
.. versionchanged:: 3.4
290300
Added *file* parameter.
291301

@@ -304,8 +314,11 @@ operation is being performed, so the intermediate analysis object isn't useful:
304314
.. versionchanged:: 3.14
305315
Added the *show_positions* parameter.
306316

317+
.. versionchanged:: next
318+
Added the *show_jit* parameter.
319+
307320
.. function:: distb(tb=None, *, file=None, show_caches=False, adaptive=False,\
308-
show_offset=False, show_positions=False)
321+
show_offsets=False, show_positions=False, show_jit=False)
309322

310323
Disassemble the top-of-stack function of a traceback, using the last
311324
traceback if none was passed. The instruction causing the exception is
@@ -326,10 +339,14 @@ operation is being performed, so the intermediate analysis object isn't useful:
326339
.. versionchanged:: 3.14
327340
Added the *show_positions* parameter.
328341

342+
.. versionchanged:: next
343+
Added the *show_jit* parameter.
344+
329345
.. function:: disassemble(code, lasti=-1, *, file=None, show_caches=False,\
330-
adaptive=False, show_offsets=False, show_positions=False)
346+
adaptive=False, show_offsets=False, show_positions=False,\
347+
show_jit=False)
331348
disco(code, lasti=-1, *, file=None, show_caches=False, adaptive=False,\
332-
show_offsets=False, show_positions=False)
349+
show_offsets=False, show_positions=False, show_jit=False)
333350
334351
Disassemble a code object, indicating the last instruction if *lasti* was
335352
provided. The output is divided in the following columns:
@@ -362,7 +379,10 @@ operation is being performed, so the intermediate analysis object isn't useful:
362379
.. versionchanged:: 3.14
363380
Added the *show_positions* parameter.
364381

365-
.. function:: get_instructions(x, *, first_line=None, show_caches=False, adaptive=False)
382+
.. versionchanged:: next
383+
Added the *show_jit* parameter.
384+
385+
.. function:: get_instructions(x, *, first_line=None, show_caches=False, adaptive=False, show_jit=False)
366386

367387
Return an iterator over the instructions in the supplied function, method,
368388
source code string or code object.
@@ -377,6 +397,8 @@ operation is being performed, so the intermediate analysis object isn't useful:
377397

378398
The *adaptive* parameter works as it does in :func:`dis`.
379399

400+
The *show_jit* parameter works as it does in :func:`dis`.
401+
380402
.. versionadded:: 3.4
381403

382404
.. versionchanged:: 3.11
@@ -388,6 +410,9 @@ operation is being performed, so the intermediate analysis object isn't useful:
388410
field populated (regardless of the value of *show_caches*) and it no longer
389411
generates separate items for the cache entries.
390412

413+
.. versionchanged:: next
414+
Added the *show_jit* parameter.
415+
391416
.. function:: findlinestarts(code)
392417

393418
This generator function uses the :meth:`~codeobject.co_lines` method

0 commit comments

Comments
 (0)