On this page
inspect.Traceback
Prev: inspect.Signature | Up: inspect
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org — inspect.Traceback
Tags: #public #python3 #stdlib #inspect
Import
import inspect
from inspect import Traceback
Signature & Overview
inspect.Traceback(filename, lineno, function, code_context, index, *, positions=None)
inspect.Traceback class.
Methods & Attributes
Traceback.count(self, value, /)— Return number of occurrences of value.
Usage
import inspect
tb = inspect.getframeinfo(inspect.currentframe())
assert isinstance(tb, inspect.Traceback) and tb.lineno > 0
Gotchas
- Returned by
inspect.getframeinfo(): Named tuple(filename, lineno, function, code_context, index).
REPL Inspect
from inspect import Traceback
help(Traceback)
Linked from
Related notes
- tuts/python3/stdlib_module/inspect/Signature Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/inspect/ArgInfo Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/Arguments Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/Attribute Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BlockFinder Linked here; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BoundArguments shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/BufferFlags shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/ClassFoundException shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/classify_class_attrs shared tags: #inspect, #stdlib