picop.cyframe#

Fast frame-object accessors (CPython 3.10+).

picop.cyframe.frame_back(frame)#

Return the previous frame, or None when there is none.

Parameters:

frame (object)

Return type:

object | None

picop.cyframe.frame_builtins(frame)#

Return the builtins namespace for frame.

Parameters:

frame (object)

Return type:

object

picop.cyframe.frame_check(frame)#

Return whether frame is a frame object.

Parameters:

frame (object)

Return type:

bool

picop.cyframe.frame_code(frame)#

Return the code object executed by frame.

Parameters:

frame (object)

Return type:

object

picop.cyframe.frame_generator(frame)#

Return the generator or coroutine owning frame, if any.

Parameters:

frame (object)

Return type:

object | None

picop.cyframe.frame_globals(frame)#

Return the global namespace for frame.

Parameters:

frame (object)

Return type:

object

picop.cyframe.frame_lasti(frame)#

Return the last instruction offset for frame.

Parameters:

frame (object)

Return type:

int

picop.cyframe.frame_lineno(frame)#

Return the current source line for frame.

Parameters:

frame (object)

Return type:

int

picop.cyframe.frame_locals(frame)#

Return the live local namespace for frame.

Notes

Function frames expose a FrameLocalsProxy; module frames expose a dict.

Parameters:

frame (object)

Return type:

object

picop.cyframe.frame_var(frame, name)#

Return the value of name in frame.

Parameters:
Return type:

object

picop.cyframe.frame_var_cstr(frame, name)#

Return the value of the NUL-terminated name in frame.

Notes

Pass name as bytes; embedded NUL bytes terminate the C string.

Parameters:
Return type:

object