GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Theming support for _colorize · Issue #133346 · python/cpython Closed Labels stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement DescriptionAs mentioned in #131507 and #130645, theming support is an important piece of the puzzle in introducing color to Python output in the terminal. Design goalsSimplicity of use with type safetyIt should be as easy to use theming as to operate with colors by hand. User configurability through $PYTHONSTARTUPIt should be trivially possible for the user to set up their own favorite colors in their Theme exchange through PyPIIt should be possible for the user to Forward-compatibility of old themesIt should be possible for the user to keep using a theme from 3.14 in future versions of Python without changes. The new color definitions would be automatically taken from the default theme. Immutability of theme objectsIt should be impossible for user code to modify the default theme in place as this can lead to inconsistencies. ImplementationTypesThe For convenience, each theme section inherits from a The Using themes in stdlib codePython standard libraries using color themes should be using the Implementations can optionally also directly call Importantly, standard libraries should never cache output of
ConfigurationThe end user can import
In non-interactive use of Python, the Rejected IdeasIntroduce a new configuration fileThere are already too many configuration files. Given Python's extensible nature, a format like TOML or INI would become insufficient. This would require a lengthy discussion, in which time no theming support would be available to users at all. Use simple dictionariesThis is easier to implement but makes type-checking harder, allows user code to override color codes at will (which can lead to broken terminal output), and provides less conveniences for creating derivative themes from the default one. Introduce a theme like
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |