Top Description Fields Constructors Methods
org.python.core

public Class PyDictProxy

extends PyObject
implements Traverseproc
Class Inheritance
All Implemented Interfaces
org.python.core.Traverseproc
Annotations
@ExposedType
name:dictproxy
isBaseType:false
Imports
org.python.expose.ExposedMethod, .ExposedType, .MethodType

Readonly proxy for dictionaries (actually any mapping).

Field Summary

Modifier and TypeField and Description
pack-priv PyObject
dict

The dict proxied to.

Inherited from org.python.core.PyObject:
attributesgcMonitorGlobalobjtypeTYPE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
__cmp__(PyObject
the object to compare this with.
other
)

Overrides org.python.core.PyObject.__cmp__.

Equivalent to the standard Python __cmp__ method.

public PyObject
__finditem__(PyObject
the key to lookup in this container
key
)

Overrides org.python.core.PyObject.__finditem__.

Very similar to the standard Python __getitem__ method.

public PyObject
__iter__()

Overrides org.python.core.PyObject.__iter__.

Return an iterator that is used to iterate the element of this sequence.

public int
__len__()

Overrides org.python.core.PyObject.__len__.

Equivalent to the standard Python __len__ method.

public PyString
__str__()

Overrides org.python.core.PyObject.__str__.

Equivalent to the standard Python __str__ method.

public int
public boolean
public PyObject
public PyObject
public PyObject
public PyObject
public PyObject
public PyObject
public PyObject
public PyObject
public PyObject
dictproxy_get(PyObject key, PyObject default_object)

public boolean
public PyObject
public PyObject
public PyObject
public PyObject
public PyObject
public PyObject
public boolean
public boolean
public boolean
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____coerce____coerce_ex____complex____contains____delattr____delattr____delete____delitem____delitem____delslice____delslice____dir____div____divmod____ensure_finalizer____eq____findattr____findattr____findattr_ex____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____iternext____itruediv____ixor____le____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____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__equalsfastGetClassfastGetDictfinalizegetDictgetJavaProxygetTypehashCodeimpAttrimplementsDescrDeleteimplementsDescrGetimplementsDescrSetinvokeinvokeinvokeinvokeinvokeinvokeisCallableisDataDescrisIndexisIntegerisNumberTypejdontdelmergeClassDictmergeDictAttrmergeListAttrnoAttributeErrorobject___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

dictback to summary
pack-priv PyObject dict

The dict proxied to.

Constructor Detail

PyDictProxyback to summary
public PyDictProxy(PyObject dict)

Method Detail

__cmp__back to summary
public int __cmp__(PyObject other)

Overrides org.python.core.PyObject.__cmp__.

Doc from org.python.core.PyObject.__cmp__.

Equivalent to the standard Python __cmp__ method.

Parameters
other:PyObject

the object to compare this with.

Returns:int

-1 if this<o; 0 if this==o; +1 if this>o; -2 if no comparison is implemented

Annotations
@Override

__finditem__back to summary
public PyObject __finditem__(PyObject key)

Overrides org.python.core.PyObject.__finditem__.

Doc from org.python.core.PyObject.__finditem__.

Very similar to the standard Python __getitem__ method. Instead of throwing a KeyError if the item isn't found, this just returns null. Classes that wish to implement __getitem__ should override this method instead (with the appropriate semantics.

Parameters
key:PyObject

the key to lookup in this container

Returns:PyObject

the value corresponding to key or null if key is not found

Annotations
@Override

__iter__back to summary
public PyObject __iter__()

Overrides org.python.core.PyObject.__iter__.

Doc from org.python.core.PyObject.__iter__.

Return an iterator that is used to iterate the element of this sequence. From version 2.2, this method is the primary protocol for looping over sequences.

If a PyObject subclass should support iteration based in the __finditem__() method, it must supply an implementation of __iter__() like this:

public PyObject __iter__() {
    return new PySequenceIter(this);
}
When iterating over a python sequence from java code, it should be done with code like this:
for (PyObject item : seq.asIterable()) {
    // Do something with item
}
Annotations
@Override
__len__back to summary
public int __len__()

Overrides org.python.core.PyObject.__len__.

Doc from org.python.core.PyObject.__len__.

Equivalent to the standard Python __len__ method. Part of the mapping discipline.

Returns:int

the length of the object

Annotations
@Override

__str__back to summary
public PyString __str__()

Overrides org.python.core.PyObject.__str__.

Doc from org.python.core.PyObject.__str__.

Equivalent to the standard Python __str__ method. The default implementation (in PyObject) calls __repr__(), making it unnecessary to override __str__ in sub-classes of PyObject where both forms are the same. A common choice is to provide the same implementation to __str__ and toString, for consistency in the printed form of objects between Python and Java.

Annotations
@Override
@ExposedMethod
dictproxy___cmp__back to summary
public int dictproxy___cmp__(PyObject other)
Annotations
@ExposedMethod
type:CMP
dictproxy___contains__back to summary
public boolean dictproxy___contains__(PyObject value)
Annotations
@ExposedMethod
dictproxy___eq__back to summary
public PyObject dictproxy___eq__(PyObject other)
Annotations
@ExposedMethod
type:BINARY
dictproxy___ge__back to summary
public PyObject dictproxy___ge__(PyObject other)
Annotations
@ExposedMethod
type:BINARY
dictproxy___getitem__back to summary
public PyObject dictproxy___getitem__(PyObject key)
Annotations
@ExposedMethod
dictproxy___gt__back to summary
public PyObject dictproxy___gt__(PyObject other)
Annotations
@ExposedMethod
type:BINARY
dictproxy___le__back to summary
public PyObject dictproxy___le__(PyObject other)
Annotations
@ExposedMethod
type:BINARY
dictproxy___lt__back to summary
public PyObject dictproxy___lt__(PyObject other)
Annotations
@ExposedMethod
type:BINARY
dictproxy___ne__back to summary
public PyObject dictproxy___ne__(PyObject other)
Annotations
@ExposedMethod
type:BINARY
dictproxy_copyback to summary
public PyObject dictproxy_copy()
Annotations
@ExposedMethod
dictproxy_getback to summary
public PyObject dictproxy_get(PyObject key, PyObject default_object)
Annotations
@ExposedMethod
defaults:Py.None
dictproxy_has_keyback to summary
public boolean dictproxy_has_key(PyObject key)
Annotations
@ExposedMethod
dictproxy_itemsback to summary
public PyObject dictproxy_items()
Annotations
@ExposedMethod
dictproxy_iteritemsback to summary
public PyObject dictproxy_iteritems()
Annotations
@ExposedMethod
dictproxy_iterkeysback to summary
public PyObject dictproxy_iterkeys()
Annotations
@ExposedMethod
dictproxy_itervaluesback to summary
public PyObject dictproxy_itervalues()
Annotations
@ExposedMethod
dictproxy_keysback to summary
public PyObject dictproxy_keys()
Annotations
@ExposedMethod
dictproxy_valuesback to summary
public PyObject dictproxy_values()
Annotations
@ExposedMethod
isMappingTypeback to summary
public boolean isMappingType()

Overrides org.python.core.PyObject.isMappingType.

Annotations
@Override
isSequenceTypeback to summary
public boolean isSequenceType()

Overrides org.python.core.PyObject.isSequenceType.

Annotations
@Override
refersDirectlyToback to summary
public boolean refersDirectlyTo(PyObject ob)

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
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