The "build" command now also runs "pythoninfo-build" and
"pythoninfo-host" commands.
If no subcommand is provided, display the help.
GitHub Action "WASI":
* Add "pythoninfo-build" and "pythoninfo-host" commands.
* Remove unused and outdated CROSS_BUILD_PYTHON environment variable.
The tkinter.Variable methods trace_variable(), trace(), trace_vdelete()
and trace_vinfo(), deprecated since Python 3.14, are now scheduled for
removal in Python 3.17.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Move the compile-time optimizations (_optimize_charset, _compile_charset,
_simple, _compile_info and the literal/charset prefix helpers) out of
_compiler.py into a new Lib/re/_optimizer.py. _compiler.py keeps only the
bytecode emitter and imports them. This is groundwork for a follow-up
optimization; there is no behavior change.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Implement set difference [A--B], intersection [A&&B] and union [A||B] in
regular expression character classes (Unicode Technical Standard #18),
including nested, complemented and compound set operands. Symmetric
difference [A~~B] remains reserved.
Also use the new syntax in the standard library (_strptime, textwrap,
doctest, pkgutil).
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
macOS records the caret only for the key window, so the query reads back
zeros instead of the values set in the test.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Add window methods and module functions that report curses state which could
previously only be set: the window getters is_cleared(), is_idcok(),
is_idlok(), is_immedok(), is_keypad(), is_leaveok(), is_nodelay(),
is_notimeout(), is_pad(), is_scrollok(), is_subwin(), is_syncok(),
getdelay(), getparent() and getscrreg(), and the functions is_cbreak(),
is_echo(), is_nl() and is_raw(). They are available when built against an
ncurses with NCURSES_EXT_FUNCS.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add alloc_pair(), find_pair(), free_pair() and reset_color_pairs(),
wrapping the ncurses extended-color dynamic pair management. They are
available only when built against a wide-character ncurses with
extended-color support.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add short group intros before each cluster of Misc methods.
Group the Tk and Toplevel classes in a new "Toplevel widgets" section, move
the Tcl() function to the module-level functions, and move the "File
handlers" section into the reference.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
CalledProcessError previously formatted cmd as `"... '%s' ..."`. This lead to
unbalanced quoting when cmd contains single-quotes or, more commonly, when cmd
is a list. This change updates the relevant format strings to use %r instead.
Co-authored-by: Benjy Wiener <benjywiener@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Run the generic DTrace/SystemTap commands in a new process group and
terminate the whole group on timeout.
This prevents a forked tracer child from keeping stdout/stderr pipes
open after the direct tracer process is killed.
show_jit was added to dis.dis(), distb(), disassemble(), get_instructions() and the Bytecode class (gh-150478) but was never documented. Document it across those APIs with a versionchanged:: 3.16 note, and fix a pre-existing show_offset -> show_offsets typo in the distb signature.
Add the X/Open Curses SCREEN API for driving more than one terminal:
newterm() and set_term(), plus the ncurses extension new_prescr().
A new screen object wraps the C SCREEN. It exposes the terminal's
standard window as screen.stdscr. Each window keeps a reference to its
screen (like a subwindow does to its parent window), so the screen is
deleted automatically once it and all of its windows are unreferenced.
The ncurses use_screen()/use_window() locking helpers are exposed as
the screen.use() and window.use() methods.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
wcwidth() only classifies combining characters in a locale that can
encode them, so guard the wide-character test operations on encodability.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A character set containing exactly one category, e.g. [\d] or [^\s], now
compiles to a single CATEGORY opcode (like \d or \S) instead of an IN
block. The negated form maps to the complementary category. This speeds
up matching and reduces the size of the compiled byte code.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Spinbox, Scale and ttk.Spinbox format floating-point values according to
the LC_NUMERIC locale, but such values are always parsed with a period, so
a comma-decimal locale breaks DoubleVar.get().
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Add docstrings for the curses.window, curses.error, curses.panel.panel
and curses.panel.error classes. Document the panel class and its error
exception in curses.panel.rst, using the real lowercase panel name.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Tcl 8.x crashes when title-casing a non-BMP character during Tk
initialization, so such a className is now rejected with a ValueError.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The character-cell window methods now accept a full character cell -- a
spacing character optionally followed by combining characters (up to
CCHARW_MAX wide characters) -- in addition to a single int or byte
character. This affects addch(), bkgd(), bkgdset(), border(), box(),
echochar(), hline(), insch() and vline(); they dispatch to the ncursesw
wide-character functions (wadd_wch(), wbkgrnd(), wborder_set(),
wecho_wchar(), whline_set(), wins_wch(), wvline_set(), ...) when given a
string. border() and box() cannot mix integer or byte characters with
wide string characters in a single call. A cell is one spacing character
optionally followed by combining characters, so an extra spacing or
control character (such as "ab") is rejected with ValueError rather than
being silently truncated by setcchar().
Also add the wide-character read methods get_wstr() and in_wstr(), the
counterparts of getstr() and instr() that return a str rather than a
bytes object, and the module functions erasewchar(), killwchar() and
wunctrl(), the wide-character counterparts of erasechar(), killchar()
and unctrl().
All of this is available only when built against the wide-character
ncursesw library.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Character class escapes (``\d``, ``\D``, ``\s``, ``\S``, ``\w`` and
``\W``) that occur outside a character set are now compiled directly to a
single CATEGORY opcode instead of being wrapped in an IN block. This
removes the IN wrapper (three code words) and an indirect charset() call,
and makes such an escape a simple repeatable unit so that, for example,
``\d+`` uses the REPEAT_ONE fast path; a CATEGORY case is added to
SRE(count).
The transformation preserves behaviour exactly. For category-heavy
patterns the compiled byte code is about 20% smaller and matching is up
to ~2x faster, with no effect on patterns that do not use bare category
escapes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>