Top Description Fields Constructors Methods
org.python.core

public Class PyFrame

extends PyObject
implements Traverseproc
Class Inheritance
All Implemented Interfaces
org.python.core.Traverseproc
Annotations
@ExposedType
name:frame
isBaseType:false
Imports
org.python.expose.ExposedDelete, .ExposedGet, .ExposedSet, .ExposedType

A Python frame object.

Field Summary

Modifier and TypeField and Description
private int
public PyFrame
f_back

Previous frame or null.

public PyObject
f_builtins

builtin symbol table.

public PyBaseCode
f_code

The underyling code object.

public PyCell[]
f_env

Nested scopes: cell + free env.

public PyObject[]
f_exits

with context exits - used by generated bytecode

public PyObject[]
public PyObject
f_globals

Global symbol table.

public int
public int
f_lineno

Current line number.

public PyObject
f_locals

Local symbol table.

public int
public int
public Object[]
private Object
private static final String
private static final String
public TraceFunction
tracefunc

An interface to functions suitable for tracing, e.g. via sys.settrace().

public static final PyType
private static final String
Inherited from org.python.core.PyObject:
attributesgcMonitorGlobalobjtype

Constructor Summary

AccessConstructor and Description
public
PyFrame(PyBaseCode code, PyObject locals, PyObject globals, PyObject builtins)

public
PyFrame(PyBaseCode code, PyObject globals)

Method Summary

Modifier and TypeMethod and Description
public Object
public void
public void
dellocal(int index)

public void
public void
private PyObject
public PyObject
getclosure(int index)

public PyObject
getderef(int index)

public PyObject

Returns:

a PyObject mapping of locals
getf_locals
()

Return the current f_locals dict.

public Object
public PyObject
public int
public PyObject
getlocal(int index)

public PyObject

Returns:

a PyObject mapping of locals
getLocals
()

Return the locals dict.

public PyObject
getname(String index)

public PyObject
public boolean
public void
setderef(int index, PyObject value)

pack-priv void
public void
setglobal(String index, PyObject value)

public void
setline(int line)

Track the current line number.

public void
setlocal(int index, PyObject value)

public void
setlocal(String index, PyObject value)

public void
pack-priv void
setupEnv(PyTuple
a PyTuple value
freevars
)

Populate the frame with closure variables, but at most once.

public void
to_cell(int parm_index, int env_index)

public int
traverse(Visitproc visit, Object arg)

Implements org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects.

Inherited from org.python.core.PyObject:
__abs____add____and____call____call____call____call____call____call____call____call____call____call____call____call____call____call____call____call____cmp____coerce____coerce_ex____complex____contains____delattr____delattr____delete____delitem____delitem____delslice____delslice____dir____div____divmod____ensure_finalizer____eq____findattr____findattr____findattr_ex____finditem____finditem____finditem____float____floordiv____format____ge____get____getattr____getattr____getitem____getitem____getnewargs____getslice____getslice____gt____hash____hex____iadd____iand____idiv____idivmod____ifloordiv____ilshift____imod____imul____index____int____invert____ior____ipow____irshift____isub____iter____iternext____itruediv____ixor____le____len____long____lshift____lt____mod____mul____ne____neg____nonzero____not____oct____or____pos____pow____pow____radd____rand____rawdir____rdiv____rdivmod____reduce____reduce_ex____reduce_ex____repr____rfloordiv____rlshift____rmod____rmul____ror____rpow____rrshift____rshift____rsub____rtruediv____rxor____set____setattr____setattr____setitem____setitem____setitem____setslice____setslice____str____sub____tojava____truediv____trunc____unicode____xor___add_and_basic_add_basic_and_basic_div_basic_divmod_basic_floordiv_basic_iadd_basic_iand_basic_idiv_basic_idivmod_basic_ifloordiv_basic_ilshift_basic_imod_basic_imul_basic_ior_basic_ipow_basic_irshift_basic_isub_basic_itruediv_basic_ixor_basic_lshift_basic_mod_basic_mul_basic_or_basic_pow_basic_rshift_basic_sub_basic_truediv_basic_xor_callextra_cmp_coerce_div_divmod_doget_doget_doset_eq_floordiv_ge_gt_iadd_iand_idiv_idivmod_ifloordiv_ilshift_imod_imul_in_ior_ipow_irshift_is_isnot_isub_itruediv_ixor_jcall_jcallexc_jthrow_le_lshift_lt_mod_mul_ne_notin_or_pow_rshift_sub_truediv_unsupportedop_xoradaptToCoerceTupleasDoubleasIndexasIndexasIntasIntasIterableasLongasLongasNameasNameasStringasStringasStringOrNullasStringOrNullbit_lengthconjugatedelDictdelTypedispatch__init__equalsfastGetClassfastGetDictfinalizegetDictgetJavaProxygetTypehashCodeimpAttrimplementsDescrDeleteimplementsDescrGetimplementsDescrSetinvokeinvokeinvokeinvokeinvokeinvokeisCallableisDataDescrisIndexisIntegerisMappingTypeisNumberTypeisSequenceTypejdontdelmergeClassDictmergeDictAttrmergeListAttrnoAttributeErrorobject___contains__object___delattr__object___delattr__object___findattr__object___format__object___getattribute__object___hash__object___init__object___new__object___reduce__object___reduce_ex__object___setattr__object___setattr__object___subclasshook__object_toStringproxyInitreadonlyAttributeErrorrunsupportedopMessagesetDictsetTypetoStringunsupportedopMessage

Field Detail

env_jback to summary
private int env_j
f_backback to summary
public PyFrame f_back

Previous frame or null.

Annotations
@ExposedGet

f_builtinsback to summary
public PyObject f_builtins

builtin symbol table.

Annotations
@ExposedGet

f_codeback to summary
public PyBaseCode f_code

The underyling code object.

Annotations
@ExposedGet

f_envback to summary
public PyCell[] f_env

Nested scopes: cell + free env.

f_exitsback to summary
public PyObject[] f_exits

with context exits - used by generated bytecode

f_fastlocalsback to summary
public PyObject[] f_fastlocals
f_globalsback to summary
public PyObject f_globals

Global symbol table.

Annotations
@ExposedGet

f_lastiback to summary
public int f_lasti
Annotations
@ExposedGet
f_linenoback to summary
public int f_lineno

Current line number.

f_localsback to summary
public PyObject f_locals

Local symbol table.

f_ncellsback to summary
public int f_ncells
f_nfreevarsback to summary
public int f_nfreevars
f_savedlocalsback to summary
public Object[] f_savedlocals
generatorInputback to summary
private Object generatorInput
GLOBAL_NAME_ERROR_MSGback to summary
private static final String GLOBAL_NAME_ERROR_MSG
NAME_ERROR_MSGback to summary
private static final String NAME_ERROR_MSG
tracefuncback to summary
public TraceFunction tracefunc

An interface to functions suitable for tracing, e.g. via sys.settrace().

TYPEback to summary
public static final PyType TYPE

Hides org.python.core.PyObject.TYPE.

UNBOUNDLOCAL_ERROR_MSGback to summary
private static final String UNBOUNDLOCAL_ERROR_MSG

Constructor Detail

PyFrameback to summary
public PyFrame(PyBaseCode code, PyObject locals, PyObject globals, PyObject builtins)
PyFrameback to summary
public PyFrame(PyBaseCode code, PyObject globals)

Method Detail

checkGeneratorInputback to summary
public Object checkGeneratorInput()
delglobalback to summary
public void delglobal(String index)
dellocalback to summary
public void dellocal(int index)
dellocalback to summary
public void dellocal(String index)
delTraceback to summary
public void delTrace()
Annotations
@ExposedDelete
name:f_trace
doGetglobalback to summary
private PyObject doGetglobal(String index)
getclosureback to summary
public PyObject getclosure(int index)
getderefback to summary
public PyObject getderef(int index)
getf_localsback to summary
public PyObject getf_locals()

Return the current f_locals dict.

Returns:PyObject

a PyObject mapping of locals

getGeneratorInputback to summary
public Object getGeneratorInput()
getglobalback to summary
public PyObject getglobal(String index)
getlineback to summary
public int getline()
Annotations
@ExposedGet
name:f_lineno
getlocalback to summary
public PyObject getlocal(int index)
getLocalsback to summary
public PyObject getLocals()

Return the locals dict. First merges the fast locals into f_locals, then returns the updated f_locals.

Returns:PyObject

a PyObject mapping of locals

Annotations
@ExposedGet
name:f_locals

getnameback to summary
public PyObject getname(String index)
getTraceback to summary
public PyObject getTrace()
Annotations
@ExposedGet
name:f_trace
refersDirectlyToback to summary
public boolean refersDirectlyTo(PyObject ob) throws UnsupportedOperationException

Implements org.python.core.Traverseproc.refersDirectlyTo.

Doc from org.python.core.Traverseproc.refersDirectlyTo.

Optional operation. Should only be implemented if it is more efficient than calling traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.

Annotations
@Override
setderefback to summary
public void setderef(int index, PyObject value)
setGeneratorInputback to summary
pack-priv void setGeneratorInput(Object value)
setglobalback to summary
public void setglobal(String index, PyObject value)
setlineback to summary
public void setline(int line)

Track the current line number. Called by generated code. This is not to be confused with the CPython method frame_setlineno() which causes the interpreter to jump to the given line.

setlocalback to summary
public void setlocal(int index, PyObject value)
setlocalback to summary
public void setlocal(String index, PyObject value)
setTraceback to summary
public void setTrace(PyObject trace)
Annotations
@ExposedSet
name:f_trace
setupEnvback to summary
pack-priv void setupEnv(PyTuple freevars)

Populate the frame with closure variables, but at most once.

Parameters
freevars:PyTuple

a PyTuple value

to_cellback to summary
public void to_cell(int parm_index, int env_index)
traverseback to summary
public int traverse(Visitproc visit, Object arg)

Implements org.python.core.Traverseproc.traverse.

Doc from org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc#visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc#visit(PyObject, Object) must not be called with a null PyObject-argument.

Annotations
@Override