Lines Matching refs:frame

23     currentframe() - get the current stack frame
436 gi_frame frame object or possibly None once the generator has
460 tb_frame frame object at this level
467 """Return true if the object is a frame object.
470 f_back next outer frame object (this frame's caller)
471 f_builtins built-in namespace seen by this frame
472 f_code code object being executed in this frame
473 f_globals global namespace seen by this frame
476 f_locals local namespace seen by this frame
477 f_trace tracing function for this frame, or None"""
920 raise TypeError('module, class, method, function, traceback, frame, or '
1058 The argument may be a module, class, method, function, traceback, frame,
1238 The argument may be a module, class, method, function, traceback, frame,
1249 # for module or frame that corresponds to module, return all source lines
1259 The argument may be a module, class, method, function, traceback, frame,
1431 def getargvalues(frame):
1432 """Get information about arguments passed into a particular frame.
1437 'locals' is the locals dictionary of the given frame."""
1438 args, varargs, varkw = getargs(frame.f_code)
1439 return ArgInfo(args, varargs, varkw, frame.f_locals)
1635 # -------------------------------------------------- stack frame extraction
1662 def getframeinfo(frame, context=1):
1663 """Get information about a frame or traceback object.
1670 if istraceback(frame):
1671 positions = _get_code_position_from_tb(frame)
1672 lineno = frame.tb_lineno
1673 frame = frame.tb_frame
1675 lineno = frame.f_lineno
1676 positions = _get_code_position(frame.f_code, frame.f_lasti)
1679 frame, *positions = (frame, lineno, *positions[1:])
1681 frame, *positions = (frame, *positions)
1685 if not isframe(frame):
1686 raise TypeError('{!r} is not a frame or traceback object'.format(frame))
1688 filename = getsourcefile(frame) or getfile(frame)
1692 lines, lnum = findsource(frame)
1702 return Traceback(filename, lineno, frame.f_code.co_name, lines,
1705 def getlineno(frame):
1706 """Get the line number from a frame object, allowing for optimization."""
1708 return frame.f_lineno
1710 _FrameInfo = namedtuple('_FrameInfo', ('frame',) + Traceback._fields)
1712 def __new__(cls, frame, filename, lineno, function, code_context, index, *, positions=None):
1713 instance = super().__new__(cls, frame, filename, lineno, function, code_context, index)
1718 return ('FrameInfo(frame={!r}, filename={!r}, lineno={!r}, function={!r}, '
1720 self.frame, self.filename, self.lineno, self.function,
1723 def getouterframes(frame, context=1):
1724 """Get a list of records for a frame and all higher (calling) frames.
1726 Each record contains a frame object, filename, line number, function
1729 while frame:
1730 traceback_info = getframeinfo(frame, context)
1731 frameinfo = (frame,) + traceback_info
1733 frame = frame.f_back
1737 """Get a list of records for a traceback's frame and all lower frames.
1739 Each record contains a frame object, filename, line number, function
1750 """Return the frame of the caller or None if this is not possible."""
1754 """Return a list of records for the stack above the caller's frame."""
1891 frame = getattr(generator, "gi_frame", None)
1892 if frame is not None:
1929 frame = getattr(coroutine, "cr_frame", None)
1930 if frame is not None:
1931 return frame.f_locals