On this page
  1. inspect.getframeinfo
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

inspect.getframeinfo

Prev: inspect.getfile | Up: inspect | Next: inspect.getfullargspec
Rel: inspect.ArgInfo, inspect.Arguments, inspect.Attribute, inspect.BlockFinder
Ref: docs.python.org — inspect.getframeinfo
Tags: #public #python3 #stdlib #inspect


Import

import inspect
from inspect import getframeinfo

Signature & Overview

inspect.getframeinfo(frame, context=1)

Get information about a frame or traceback object.

Usage

import inspect

info = inspect.getframeinfo(inspect.currentframe())
assert info.lineno > 0 and isinstance(info.filename, str)

Gotchas

REPL Inspect

from inspect import getframeinfo
help(getframeinfo)

Linked from

Related notes