Uh oh!
There was an error while loading. Please reload this page.
gh-133346: Make theming support in _colorize extensible - #133347
Conversation
| class ColorSpan(NamedTuple): | ||
| span: Span | ||
| tag: _colorize.ColorTag | ||
| tag: str |
There was a problem hiding this comment.
I'm a little sad about this but currently Python typing cannot construct a type that is "a set of string literals from this type's attributes" and I didn't feel like repeating myself in _colorize.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
hugovk
left a comment
There was a problem hiding this comment.
Thanks, it's much nicer to specify semantic meanings rather than colours in the code.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
pablogsal
left a comment
There was a problem hiding this comment.
This LGTM I left some comments and questions but nothing blocking.
I have a request though: I think we should explore offering some semi-final non-experimental way to support this in 3.14 with proper documentation. If @hugovk is fine with this, I would like to propose a discussion in an issue and maybe with the SC. I don't particularly thing this needs a PEP by any means (my personal opinion non SC hat on) but I think that releasing 3.14 with colorize.set_theme() with the docs being a comment is not great and maybe it is worth an exception.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
hugovk
commented
May 5, 2025
Fine by me. |
tomasr8
left a comment
There was a problem hiding this comment.
Exciting stuff! Json changes look good 🙂
Uh oh!
There was an error while loading. Please reload this page.
| import sys | ||
| from collections.abc import Callable, Iterator, Mapping | ||
| from dataclasses import dataclass, field, Field |
There was a problem hiding this comment.
It's a little unfortunate for import times that this will bring a dependency on dataclasses module to all modules that import this. :-(
…GH-133347) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
See issue for design details.