mirror of
https://github.com/python/cpython.git
synced 2026-06-28 03:41:13 +00:00
Add the immutable `curses.complexchar` type: a styled wide-character cell — a spacing character optionally followed by combining characters, plus attributes and a color pair. The color pair is stored separately rather than packed into a `chtype` via `COLOR_PAIR()`, so it is not limited to the values that fit alongside the attribute bits. `str(cc)` returns the text; the read-only `attr` and `pair` attributes return its rendition. Add the window methods `in_wch()` and `getbkgrnd()` — the wide-character counterparts of `inch()` and `getbkgd()` — which return a `complexchar`. (`inch()`/`getbkgd()` can only return a packed `chtype`, so these fill a real gap; this resolves the long-standing gh-83395 request for `in_wch`.) The existing character-cell methods (`addch`, `insch`, `echochar`, `bkgd`, `bkgdset`, `border`, `box`, `hline`, `vline`) now also accept a `complexchar`. A `complexchar` already carries its own rendition, so passing one together with an explicit `attr` argument raises `TypeError`. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| cpython | ||
| internal | ||
| abstract.h | ||
| audit.h | ||
| bltinmodule.h | ||
| boolobject.h | ||
| bytearrayobject.h | ||
| bytesobject.h | ||
| ceval.h | ||
| codecs.h | ||
| compile.h | ||
| complexobject.h | ||
| critical_section.h | ||
| datetime.h | ||
| descrobject.h | ||
| dictobject.h | ||
| dynamic_annotations.h | ||
| enumobject.h | ||
| errcode.h | ||
| exports.h | ||
| fileobject.h | ||
| fileutils.h | ||
| floatobject.h | ||
| frameobject.h | ||
| genericaliasobject.h | ||
| import.h | ||
| intrcheck.h | ||
| iterobject.h | ||
| listobject.h | ||
| longobject.h | ||
| marshal.h | ||
| memoryobject.h | ||
| methodobject.h | ||
| modsupport.h | ||
| moduleobject.h | ||
| object.h | ||
| objimpl.h | ||
| opcode.h | ||
| opcode_ids.h | ||
| osdefs.h | ||
| osmodule.h | ||
| patchlevel.h | ||
| py_curses.h | ||
| pyabi.h | ||
| pyatomic.h | ||
| pybuffer.h | ||
| pycapsule.h | ||
| pydtrace.d | ||
| pydtrace.h | ||
| pyerrors.h | ||
| pyexpat.h | ||
| pyframe.h | ||
| pyhash.h | ||
| pylifecycle.h | ||
| pymacconfig.h | ||
| pymacro.h | ||
| pymath.h | ||
| pymem.h | ||
| pyport.h | ||
| pystate.h | ||
| pystats.h | ||
| pystrcmp.h | ||
| pystrtod.h | ||
| Python.h | ||
| pythonrun.h | ||
| pythread.h | ||
| pytypedefs.h | ||
| rangeobject.h | ||
| README.rst | ||
| refcount.h | ||
| setobject.h | ||
| sliceobject.h | ||
| slots.h | ||
| slots_generated.h | ||
| structmember.h | ||
| structseq.h | ||
| sysmodule.h | ||
| traceback.h | ||
| tupleobject.h | ||
| unicodeobject.h | ||
| warnings.h | ||
| weakrefobject.h | ||
The Python C API ================ The C API is divided into these sections: 1. ``Include/``: Limited API 2. ``Include/cpython/``: CPython implementation details 3. ``Include/cpython/``, names with the ``PyUnstable_`` prefix: API that can change between minor releases 4. ``Include/internal/``, and any name with ``_`` prefix: The internal API Information on changing the C API is available `in the developer guide`_ .. _in the developer guide: https://devguide.python.org/c-api/