On this page
inspect.FrameInfo
Prev: inspect.formatargvalues | Up: inspect | Next: inspect.FullArgSpec
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org — inspect.FrameInfo
Tags: #public #python3 #stdlib #inspect
Import
import inspect
from inspect import FrameInfo
Signature & Overview
inspect.FrameInfo(frame, filename, lineno, function, code_context, index, *, positions=None)
inspect.FrameInfo class.
Methods & Attributes
FrameInfo.count(self, value, /)— Return number of occurrences of value.
Usage
import inspect
top = inspect.stack()[0]
assert isinstance(top, inspect.FrameInfo) and isinstance(top.lineno, int)
Gotchas
- Contains a live
framereference: Avoid keepingFrameInfolists alive longer than needed (or delete them promptly) to prevent reference cycles.
REPL Inspect
from inspect import FrameInfo
help(FrameInfo)
Linked from
Related notes
- tuts/python3/stdlib_module/inspect/formatargvalues Linked here; links to this page; shared tags: #inspect, #stdlib
- tuts/python3/stdlib_module/inspect/FullArgSpec 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