tpcp.misc.WarningErrorContextRecord#
- class tpcp.misc.WarningErrorContextRecord(type: Literal['warning', 'error', 'print'], context: str, message: Warning | BaseException | str)[source]#
A warning, error, or contextual print captured by an active context.
The original warning or exception object is retained as
messageso its concrete type and custom attributes remain available for later inspection. Contextual prints store their unmodified rendered text.- Attributes:
- type
The kind of captured event.
- context
The fully rendered context stack at the time of the event.
- message
The original warning or exception object, or the rendered print text.
Methods
count(value, /)Return number of occurrences of value.
index(value[, start, stop])Return first index of value.
- count(value, /)#
Return number of occurrences of value.
- index(value, start=0, stop=sys.maxsize, /)#
Return first index of value.
Raises ValueError if the value is not present.
- message: Warning | BaseException | str#
Alias for field number 2