class documentation

Syntax highlighter for Python values.

Method __init__ Undocumented
Method colorize Entry Point.
Constant COLON_TAG Undocumented
Constant COMMA_TAG Undocumented
Constant CONST_TAG Undocumented
Constant ELLIPSIS Undocumented
Constant ELLIPSIS_TAG Undocumented
Constant GENERIC_OBJECT_RE Undocumented
Constant GROUP_TAG Undocumented
Constant LINEWRAP Undocumented
Constant LINEWRAP_TAG Undocumented
Constant LINK_TAG Undocumented
Constant NEWLINE Undocumented
Constant NUMBER_TAG Undocumented
Constant QUOTE_TAG Undocumented
Constant RE_CHAR_TAG Undocumented
Constant RE_COMPILE_SIGNATURE Undocumented
Constant RE_FLAGS_TAG Undocumented
Constant RE_GROUP_TAG Undocumented
Constant RE_OP_TAG Undocumented
Constant RE_REF_TAG Undocumented
Constant STRING_TAG Undocumented
Constant UNKNOWN_REPR Undocumented
Constant UNKNOWN_TAG Undocumented
Constant WORD_BREAK_OPPORTUNITY Undocumented
Instance Variable explicit_precedence Undocumented
Instance Variable linebreakok Undocumented
Instance Variable linelen Undocumented
Instance Variable maxlines Undocumented
Instance Variable refmap Undocumented
Static Method _get_ast_constant_val Undocumented
Static Method _is_ast_constant Undocumented
Method _colorize Undocumented
Method _colorize_ast Undocumented
Method _colorize_ast_attribute Undocumented
Method _colorize_ast_binary_op Undocumented
Method _colorize_ast_bool_op Undocumented
Method _colorize_ast_call Undocumented
Method _colorize_ast_call_generic Undocumented
Method _colorize_ast_constant Undocumented
Method _colorize_ast_dict Undocumented
Method _colorize_ast_generic Undocumented
Method _colorize_ast_name Undocumented
Method _colorize_ast_re Undocumented
Method _colorize_ast_subscript Undocumented
Method _colorize_ast_unary_op Undocumented
Method _colorize_iter Undocumented
Method _colorize_re_flags Undocumented
Method _colorize_re_pattern Undocumented
Method _colorize_re_pattern_str Undocumented
Method _colorize_re_tree Undocumented
Method _colorize_str Undocumented
Method _insert_comma Undocumented
Method _multiline Helper for container-type colorizers. First, try calling func(pyval, state, **kwargs) with linebreakok set to false; and if that fails, then try again with it set to true.
Method _output Add the string s to the result list, tagging its contents with the specified css_class. Any lines that go beyond PyvalColorizer.linelen will be line-wrapped. If the total number of lines exceeds PyvalColorizer.maxlines...
Method _set_precedence Undocumented
Method _trim_result Undocumented
def __init__(self, linelen: int | None, maxlines: int, linebreakok: bool = True, refmap: dict[str, str] | None = None): (source)

Undocumented

def colorize(self, pyval: Any) -> ColorizedPyvalRepr: (source)

Entry Point.

COLON_TAG = (source)

Undocumented

Value
None
COMMA_TAG = (source)

Undocumented

Value
None
CONST_TAG = (source)

Undocumented

Value
None
ELLIPSIS = (source)

Undocumented

Value
nodes.inline('...', '...',
             classes=[ELLIPSIS_TAG])
ELLIPSIS_TAG: str = (source)

Undocumented

Value
'variable-ellipsis'
GENERIC_OBJECT_RE = (source)

Undocumented

Value
re.compile(r'^<(?P<descr>.*) at (?P<addr>0x[0-9a-f]+)>$',
           re.IGNORECASE)
GROUP_TAG = (source)

Undocumented

Value
None
LINEWRAP = (source)

Undocumented

Value
nodes.inline('', chr(8629),
             classes=[LINEWRAP_TAG])
LINEWRAP_TAG: str = (source)

Undocumented

Value
'variable-linewrap'
LINK_TAG: str = (source)

Undocumented

Value
'variable-link'

Undocumented

Value
nodes.Text('\n')
NUMBER_TAG = (source)

Undocumented

Value
None
QUOTE_TAG: str = (source)

Undocumented

Value
'variable-quote'
RE_CHAR_TAG = (source)

Undocumented

Value
None
RE_COMPILE_SIGNATURE = (source)

Undocumented

Value
signature(re.compile)
RE_FLAGS_TAG: str = (source)

Undocumented

Value
're-flags'
RE_GROUP_TAG: str = (source)

Undocumented

Value
're-group'
RE_OP_TAG: str = (source)

Undocumented

Value
're-op'
RE_REF_TAG: str = (source)

Undocumented

Value
're-ref'
STRING_TAG: str = (source)

Undocumented

Value
'variable-string'
UNKNOWN_REPR = (source)

Undocumented

Value
nodes.inline('??', '??',
             classes=[UNKNOWN_TAG])
UNKNOWN_TAG: str = (source)

Undocumented

Value
'variable-unknown'
WORD_BREAK_OPPORTUNITY = (source)

Undocumented

Value
wbr()
explicit_precedence: dict[ast.AST, int] = (source)

Undocumented

linebreakok = (source)

Undocumented

linelen: int | None = (source)

Undocumented

maxlines: int | float = (source)

Undocumented

Undocumented

@staticmethod
def _get_ast_constant_val(node: ast.AST) -> Any: (source)

Undocumented

@staticmethod
def _is_ast_constant(node: ast.AST) -> bool: (source)

Undocumented

def _colorize(self, pyval: Any, state: _ColorizerState): (source)

Undocumented

def _colorize_ast(self, pyval: ast.AST, state: _ColorizerState): (source)

Undocumented

def _colorize_ast_attribute(self, pyval: ast.Attribute, state: _ColorizerState): (source)

Undocumented

def _colorize_ast_binary_op(self, pyval: ast.BinOp, state: _ColorizerState): (source)

Undocumented

def _colorize_ast_bool_op(self, pyval: ast.BoolOp, state: _ColorizerState): (source)

Undocumented

def _colorize_ast_call(self, node: ast.Call, state: _ColorizerState): (source)

Undocumented

def _colorize_ast_call_generic(self, node: ast.Call, state: _ColorizerState): (source)

Undocumented

def _colorize_ast_constant(self, pyval: ast.AST, state: _ColorizerState): (source)

Undocumented

def _colorize_ast_dict(self, items: Iterable[tuple[ast.AST | None, ast.AST]], state: _ColorizerState, prefix: str, suffix: str): (source)

Undocumented

def _colorize_ast_generic(self, pyval: ast.AST, state: _ColorizerState): (source)

Undocumented

def _colorize_ast_name(self, pyval: ast.Name, state: _ColorizerState): (source)

Undocumented

def _colorize_ast_re(self, node: ast.Call, state: _ColorizerState): (source)

Undocumented

def _colorize_ast_subscript(self, node: ast.Subscript, state: _ColorizerState): (source)

Undocumented

def _colorize_ast_unary_op(self, pyval: ast.UnaryOp, state: _ColorizerState): (source)

Undocumented

def _colorize_iter(self, pyval: Iterable[Any], state: _ColorizerState, prefix: AnyStr | None = None, suffix: AnyStr | None = None): (source)

Undocumented

def _colorize_re_flags(self, flags: int, state: _ColorizerState): (source)

Undocumented

def _colorize_re_pattern(self, pat: AnyStr, state: _ColorizerState, prefix: AnyStr): (source)

Undocumented

def _colorize_re_pattern_str(self, pat: AnyStr, state: _ColorizerState): (source)

Undocumented

def _colorize_re_tree(self, tree: Sequence[tuple[sre_constants._NamedIntConstant, Any]], state: _ColorizerState, noparen: bool, groups: dict[int, str]): (source)

Undocumented

def _colorize_str(self, pyval: AnyStr, state: _ColorizerState, prefix: AnyStr, escape_fcn: Callable[[AnyStr], str]): (source)

Undocumented

def _insert_comma(self, indent: int, state: _ColorizerState): (source)

Undocumented

def _multiline(self, func: Callable[..., None], pyval: Iterable[Any], state: _ColorizerState, **kwargs: Any): (source)

Helper for container-type colorizers. First, try calling func(pyval, state, **kwargs) with linebreakok set to false; and if that fails, then try again with it set to true.

def _output(self, s: AnyStr, css_class: str | None, state: _ColorizerState, link: bool = False): (source)

Add the string s to the result list, tagging its contents with the specified css_class. Any lines that go beyond PyvalColorizer.linelen will be line-wrapped. If the total number of lines exceeds PyvalColorizer.maxlines, then raise a _Maxlines exception.

def _set_precedence(self, precedence: int, *node: ast.AST): (source)

Undocumented

def _trim_result(self, result: list[nodes.Node], num_chars: int): (source)

Undocumented