pub enum PrettyValue {
Show 13 variants
None,
Bool(bool),
Int(i128),
Float(f64),
Str(String),
Bytes(Vec<u8>),
Repr(String),
List(Vec<PrettyValue>),
Tuple(Vec<PrettyValue>),
Set(Vec<PrettyValue>),
FrozenSet(Vec<PrettyValue>),
Dict(Vec<(PrettyValue, PrettyValue)>),
Object(PrettyObject),
}Expand description
A Python value, as traverse sees it. Mirrors the types upstream’s
pretty.py knows how to expand (_BRACES, dataclasses, namedtuples and
__rich_repr__); anything else is an atom with its own repr
(PrettyValue::Repr).
Variants§
None
None.
Bool(bool)
True / False.
Int(i128)
An int. Larger integers can be given as PrettyValue::Repr.
Float(f64)
A float, written as Python’s repr writes it.
Str(String)
A str, written as Python’s repr writes it (and cut by max_string).
Bytes(Vec<u8>)
A bytes, written as Python’s repr writes it (and cut by max_string).
Repr(String)
Any other atom: the text is its repr, used as it is.
List(Vec<PrettyValue>)
A list.
Tuple(Vec<PrettyValue>)
A tuple (a tuple of one is written (x,)).
Set(Vec<PrettyValue>)
A set, its items in iteration order.
FrozenSet(Vec<PrettyValue>)
A frozenset, its items in iteration order.
Dict(Vec<(PrettyValue, PrettyValue)>)
A dict, its items in insertion order.
Object(PrettyObject)
An object with a structured repr: a dataclass, a namedtuple or a
__rich_repr__.