public class PyObject
extends java.lang.Object
implements java.io.Serializable
PyObject
or one of its subclasses.Modifier and Type | Class and Description |
---|---|
static class |
PyObject.ConversionException |
Modifier and Type | Field and Description |
---|---|
static boolean |
gcMonitorGlobal
This should have been suited at
gc , but that would cause a
dependency cycle in the init-phases of gc.class and PyObject.class . |
static PyType |
TYPE |
Constructor and Description |
---|
PyObject()
The standard constructor for a
PyObject . |
PyObject(PyType objtype) |
Modifier and Type | Method and Description |
---|---|
PyObject |
__abs__()
Equivalent to the standard Python __abs__ method.
|
PyObject |
__add__(PyObject other)
Equivalent to the standard Python __add__ method.
|
PyObject |
__and__(PyObject other)
Equivalent to the standard Python __and__ method
|
PyObject |
__call__()
A variant of the __call__ method with no arguments.
|
PyObject |
__call__(PyObject arg0)
A variant of the __call__ method with one argument.
|
PyObject |
__call__(PyObject[] args)
A variant of the __call__ method when no keywords are passed.
|
PyObject |
__call__(PyObject[] args,
java.lang.String[] keywords)
The basic method to override when implementing a callable object.
|
PyObject |
__call__(PyObject arg0,
PyObject arg1)
A variant of the __call__ method with two arguments.
|
PyObject |
__call__(PyObject arg1,
PyObject[] args,
java.lang.String[] keywords)
A variant of the __call__ method with one extra initial argument.
|
PyObject |
__call__(PyObject arg0,
PyObject arg1,
PyObject arg2)
A variant of the __call__ method with three arguments.
|
PyObject |
__call__(PyObject arg0,
PyObject arg1,
PyObject arg2,
PyObject arg3)
A variant of the __call__ method with four arguments.
|
PyObject |
__call__(ThreadState state) |
PyObject |
__call__(ThreadState state,
PyObject arg0) |
PyObject |
__call__(ThreadState state,
PyObject[] args) |
PyObject |
__call__(ThreadState state,
PyObject[] args,
java.lang.String[] keywords) |
PyObject |
__call__(ThreadState state,
PyObject arg0,
PyObject arg1) |
PyObject |
__call__(ThreadState state,
PyObject arg1,
PyObject[] args,
java.lang.String[] keywords) |
PyObject |
__call__(ThreadState state,
PyObject arg0,
PyObject arg1,
PyObject arg2) |
PyObject |
__call__(ThreadState state,
PyObject arg0,
PyObject arg1,
PyObject arg2,
PyObject arg3) |
int |
__cmp__(PyObject other)
Equivalent to the standard Python __cmp__ method.
|
PyObject |
__coerce__(PyObject pyo)
Equivalent to the standard Python __coerce__ method.
|
java.lang.Object |
__coerce_ex__(PyObject o)
Implements numeric coercion
|
PyComplex |
__complex__()
Equivalent to the standard Python __complex__ method.
|
boolean |
__contains__(PyObject o)
Equivalent to the standard Python __contains__ method.
|
void |
__delattr__(PyString name)
Equivalent to the standard Python __delattr__ method.
|
void |
__delattr__(java.lang.String name)
A variant of the __delattr__ method which accepts a String as the key.
|
void |
__delete__(PyObject obj) |
void |
__delitem__(PyObject key)
Equivalent to the standard Python __delitem__ method.
|
void |
__delitem__(java.lang.String key)
A variant of the __delitem__ method which accepts a String as the key.
|
void |
__delslice__(PyObject start,
PyObject stop) |
void |
__delslice__(PyObject s_start,
PyObject s_stop,
PyObject s_step) |
PyObject |
__dir__()
Equivalent to the standard Python __dir__ method.
|
PyObject |
__div__(PyObject other)
Equivalent to the standard Python __div__ method
|
PyObject |
__divmod__(PyObject other)
Equivalent to the standard Python __divmod__ method
|
void |
__ensure_finalizer__()
PyObjects that implement
org.python.core.finalization.HasFinalizeTrigger shall
implement this method via:FinalizeTrigger.ensureFinalizer(this); |
PyObject |
__eq__(PyObject other)
Equivalent to the standard Python __eq__ method.
|
PyObject |
__findattr__(PyString name)
Very similar to the standard Python __getattr__ method.
|
PyObject |
__findattr__(java.lang.String name)
A variant of the __findattr__ method which accepts a Java
String as the name. |
PyObject |
__findattr_ex__(java.lang.String name)
Attribute lookup hook.
|
PyObject |
__finditem__(int key)
A variant of the __finditem__ method which accepts a primitive
int as the key. |
PyObject |
__finditem__(PyObject key)
Very similar to the standard Python __getitem__ method.
|
PyObject |
__finditem__(java.lang.String key)
A variant of the __finditem__ method which accepts a Java
String as the key. |
PyFloat |
__float__()
Equivalent to the standard Python __float__ method.
|
PyObject |
__floordiv__(PyObject other)
Equivalent to the standard Python __floordiv__ method
|
PyObject |
__format__(PyObject formatSpec) |
PyObject |
__ge__(PyObject other)
Equivalent to the standard Python __ge__ method.
|
PyObject |
__get__(PyObject obj,
PyObject type)
Get descriptor for this PyObject.
|
PyObject |
__getattr__(PyString name)
Equivalent to the standard Python __getattr__ method.
|
PyObject |
__getattr__(java.lang.String name)
A variant of the __getattr__ method which accepts a Java
String as the name. |
PyObject |
__getitem__(int key)
Equivalent to the standard Python __getitem__ method.
|
PyObject |
__getitem__(PyObject key)
Equivalent to the standard Python __getitem__ method.
|
PyTuple |
__getnewargs__() |
PyObject |
__getslice__(PyObject start,
PyObject stop) |
PyObject |
__getslice__(PyObject s_start,
PyObject s_stop,
PyObject s_step) |
PyObject |
__gt__(PyObject other)
Equivalent to the standard Python __gt__ method.
|
PyInteger |
__hash__()
Equivalent to the standard Python __hash__ method.
|
PyString |
__hex__()
Equivalent to the standard Python __hex__ method Should only be overridden by numeric objects
that can be reasonably represented as a hexadecimal string.
|
PyObject |
__iadd__(PyObject other)
Equivalent to the standard Python __iadd__ method.
|
PyObject |
__iand__(PyObject other)
Equivalent to the standard Python __iand__ method
|
PyObject |
__idiv__(PyObject other)
Equivalent to the standard Python __idiv__ method
|
PyObject |
__idivmod__(PyObject other)
Equivalent to the standard Python __idivmod__ method
|
PyObject |
__ifloordiv__(PyObject other)
Equivalent to the standard Python __ifloordiv__ method
|
PyObject |
__ilshift__(PyObject other)
Equivalent to the standard Python __ilshift__ method
|
PyObject |
__imod__(PyObject other)
Equivalent to the standard Python __imod__ method
|
PyObject |
__imul__(PyObject other)
Equivalent to the standard Python __imul__ method.
|
PyObject |
__index__()
Equivalent to the standard Python __index__ method.
|
PyObject |
__int__()
Equivalent to the standard Python __int__ method.
|
PyObject |
__invert__()
Equivalent to the standard Python __invert__ method.
|
PyObject |
__ior__(PyObject other)
Equivalent to the standard Python __ior__ method
|
PyObject |
__ipow__(PyObject other)
Equivalent to the standard Python __ipow__ method
|
PyObject |
__irshift__(PyObject other)
Equivalent to the standard Python __irshift__ method
|
PyObject |
__isub__(PyObject other)
Equivalent to the standard Python __isub__ method
|
PyObject |
__iter__()
Return an iterator that is used to iterate the element of this sequence.
|
PyObject |
__iternext__()
Return the next element of the sequence that this is an iterator for.
|
PyObject |
__itruediv__(PyObject other)
Equivalent to the standard Python __itruediv__ method
|
PyObject |
__ixor__(PyObject other)
Equivalent to the standard Python __ixor__ method
|
PyObject |
__le__(PyObject other)
Equivalent to the standard Python __le__ method.
|
int |
__len__()
Equivalent to the standard Python __len__ method.
|
PyObject |
__long__()
Equivalent to the standard Python __long__ method.
|
PyObject |
__lshift__(PyObject other)
Equivalent to the standard Python __lshift__ method
|
PyObject |
__lt__(PyObject other)
Equivalent to the standard Python __lt__ method.
|
PyObject |
__mod__(PyObject other)
Equivalent to the standard Python __mod__ method
|
PyObject |
__mul__(PyObject other)
Equivalent to the standard Python __mul__ method.
|
PyObject |
__ne__(PyObject other)
Equivalent to the standard Python __ne__ method.
|
PyObject |
__neg__()
Equivalent to the standard Python __neg__ method.
|
boolean |
__nonzero__()
Equivalent to the standard Python __nonzero__ method.
|
PyObject |
__not__()
Implements boolean not
|
PyString |
__oct__()
Equivalent to the standard Python __oct__ method.
|
PyObject |
__or__(PyObject other)
Equivalent to the standard Python __or__ method
|
PyObject |
__pos__()
Equivalent to the standard Python __pos__ method.
|
PyObject |
__pow__(PyObject other)
Equivalent to the standard Python __pow__ method
|
PyObject |
__pow__(PyObject o2,
PyObject o3)
Implements the three argument power function.
|
PyObject |
__radd__(PyObject other)
Equivalent to the standard Python __radd__ method.
|
PyObject |
__rand__(PyObject other)
Equivalent to the standard Python __rand__ method
|
PyObject |
__rdiv__(PyObject other)
Equivalent to the standard Python __rdiv__ method
|
PyObject |
__rdivmod__(PyObject other)
Equivalent to the standard Python __rdivmod__ method
|
PyObject |
__reduce__()
Used for pickling.
|
PyObject |
__reduce_ex__() |
PyObject |
__reduce_ex__(int arg)
Used for pickling.
|
PyString |
__repr__()
Equivalent to the standard Python
__repr__ method. |
PyObject |
__rfloordiv__(PyObject other)
Equivalent to the standard Python __rfloordiv__ method
|
PyObject |
__rlshift__(PyObject other)
Equivalent to the standard Python __rlshift__ method
|
PyObject |
__rmod__(PyObject other)
Equivalent to the standard Python __rmod__ method
|
PyObject |
__rmul__(PyObject other)
Equivalent to the standard Python __rmul__ method.
|
PyObject |
__ror__(PyObject other)
Equivalent to the standard Python __ror__ method
|
PyObject |
__rpow__(PyObject other)
Equivalent to the standard Python __rpow__ method
|
PyObject |
__rrshift__(PyObject other)
Equivalent to the standard Python __rrshift__ method
|
PyObject |
__rshift__(PyObject other)
Equivalent to the standard Python __rshift__ method
|
PyObject |
__rsub__(PyObject other)
Equivalent to the standard Python __rsub__ method
|
PyObject |
__rtruediv__(PyObject other)
Equivalent to the standard Python __rtruediv__ method
|
PyObject |
__rxor__(PyObject other)
Equivalent to the standard Python __rxor__ method
|
void |
__set__(PyObject obj,
PyObject value) |
void |
__setattr__(PyString name,
PyObject value)
Equivalent to the standard Python __setattr__ method.
|
void |
__setattr__(java.lang.String name,
PyObject value)
A variant of the __setattr__ method which accepts a String as the key.
|
void |
__setitem__(int key,
PyObject value)
A variant of the __setitem__ method which accepts a primitive
int as the key. |
void |
__setitem__(PyObject key,
PyObject value)
Equivalent to the standard Python __setitem__ method.
|
void |
__setitem__(java.lang.String key,
PyObject value)
A variant of the __setitem__ method which accepts a String as the key.
|
void |
__setslice__(PyObject start,
PyObject stop,
PyObject value) |
void |
__setslice__(PyObject s_start,
PyObject s_stop,
PyObject s_step,
PyObject value) |
PyString |
__str__()
Equivalent to the standard Python __str__ method.
|
PyObject |
__sub__(PyObject other)
Equivalent to the standard Python __sub__ method
|
java.lang.Object |
__tojava__(java.lang.Class<?> c)
Equivalent to the Jython __tojava__ method.
|
PyObject |
__truediv__(PyObject other)
Equivalent to the standard Python __truediv__ method
|
PyObject |
__trunc__()
Equivalent to the standard Python __trunc__ method.
|
PyUnicode |
__unicode__() |
PyObject |
__xor__(PyObject other)
Equivalent to the standard Python __xor__ method
|
PyObject |
_add(PyObject o2)
Implements the Python expression
this + o2 . |
PyObject |
_and(PyObject o2)
Implements the Python expression
this & o2 |
PyObject |
_callextra(PyObject[] args,
java.lang.String[] keywords,
PyObject starargs,
PyObject kwargs) |
int |
_cmp(PyObject o)
Implements cmp(this, other)
|
PyObject |
_div(PyObject o2)
Implements the Python expression
this / o2 |
PyObject |
_divmod(PyObject o2)
Implements the Python expression
this divmod o2 |
PyObject |
_doget(PyObject container) |
PyObject |
_doget(PyObject container,
PyObject wherefound) |
boolean |
_doset(PyObject container,
PyObject value) |
PyObject |
_eq(PyObject o)
Implements the Python expression
this == other . |
PyObject |
_floordiv(PyObject o2)
Implements the Python expression
this // o2 |
PyObject |
_ge(PyObject o)
Implements the Python expression
this >= other . |
PyObject |
_gt(PyObject o)
Implements the Python expression
this > other . |
PyObject |
_iadd(PyObject o2)
Implements the Python expression
this += o2 . |
PyObject |
_iand(PyObject o2)
Implements the Python expression
this &= o2 |
PyObject |
_idiv(PyObject o2)
Implements the Python expression
this /= o2 |
PyObject |
_idivmod(PyObject o2)
Implements the Python expression
this divmod= o2 |
PyObject |
_ifloordiv(PyObject o2)
Implements the Python expression
this //= o2 |
PyObject |
_ilshift(PyObject o2)
Implements the Python expression
this <<= o2 |
PyObject |
_imod(PyObject o2)
Implements the Python expression
this %= o2 |
PyObject |
_imul(PyObject o2)
Implements the Python expression
this *= o2 . |
PyObject |
_in(PyObject o)
Implements
in operator. |
PyObject |
_ior(PyObject o2)
Implements the Python expression
this |= o2 |
PyObject |
_ipow(PyObject o2)
Implements the Python expression
this **= o2 |
PyObject |
_irshift(PyObject o2)
Implements the Python expression
this >>= o2 |
PyObject |
_is(PyObject o)
Implements
is operator. |
PyObject |
_isnot(PyObject o)
Implements
is not operator. |
PyObject |
_isub(PyObject o2)
Implements the Python expression
this -= o2 |
PyObject |
_itruediv(PyObject o2)
Implements the Python expression
this /= o2 |
PyObject |
_ixor(PyObject o2)
Implements the Python expression
this ^= o2 |
PyObject |
_jcall(java.lang.Object[] args) |
PyObject |
_jcallexc(java.lang.Object[] args)
A convenience function for PyProxys.
|
void |
_jthrow(java.lang.Throwable t) |
PyObject |
_le(PyObject o)
Implements the Python expression
this <= other . |
PyObject |
_lshift(PyObject o2)
Implements the Python expression
this << o2 |
PyObject |
_lt(PyObject o)
Implements the Python expression
this < other . |
PyObject |
_mod(PyObject o2)
Implements the Python expression
this % o2 |
PyObject |
_mul(PyObject o2)
Implements the Python expression
this * o2 . |
PyObject |
_ne(PyObject o)
Implements the Python expression {@code this !
|
PyObject |
_notin(PyObject o)
Implements
not in operator. |
PyObject |
_or(PyObject o2)
Implements the Python expression
this | o2 |
PyObject |
_pow(PyObject o2)
Implements the Python expression
this ** o2 |
PyObject |
_rshift(PyObject o2)
Implements the Python expression
this >> o2 |
PyObject |
_sub(PyObject o2)
Implements the Python expression
this - o2 |
PyObject |
_truediv(PyObject o2)
Implements the Python expression
this / o2 |
PyObject |
_xor(PyObject o2)
Implements the Python expression
this ^ o2 |
double |
asDouble()
Convert this object into a double.
|
int |
asIndex()
Convert this object into an index-sized integer.
|
int |
asIndex(PyObject err)
Convert this object into an index-sized integer.
|
int |
asInt()
Convert this object into an int.
|
int |
asInt(int index) |
java.lang.Iterable<PyObject> |
asIterable()
Returns an Iterable over the Python iterator returned by __iter__ on this object.
|
long |
asLong()
Convert this object longo an long.
|
long |
asLong(int index) |
java.lang.String |
asName(int index) |
static java.lang.String |
asName(PyObject obj) |
java.lang.String |
asString() |
java.lang.String |
asString(int index) |
java.lang.String |
asStringOrNull() |
java.lang.String |
asStringOrNull(int index) |
int |
bit_length()
Equivalent to the standard Python bit_length method.
|
PyObject |
conjugate()
Equivalent to the standard Python conjugate method.
|
void |
delDict() |
void |
delType() |
void |
dispatch__init__(PyObject[] args,
java.lang.String[] keywords)
Dispatch __init__ behavior
|
boolean |
equals(java.lang.Object ob_other)
Should almost never be overridden.
|
PyObject |
fastGetClass() |
PyObject |
fastGetDict()
xxx implements where meaningful
|
PyObject |
getDict()
xxx implements where meaningful
|
PyType |
getType() |
int |
hashCode() |
boolean |
implementsDescrDelete() |
boolean |
implementsDescrGet() |
boolean |
implementsDescrSet() |
PyObject |
invoke(java.lang.String name)
Shortcut for calling a method on a PyObject with no args.
|
PyObject |
invoke(java.lang.String name,
PyObject arg1)
Shortcut for calling a method on a PyObject with one arg.
|
PyObject |
invoke(java.lang.String name,
PyObject[] args) |
PyObject |
invoke(java.lang.String name,
PyObject[] args,
java.lang.String[] keywords)
Shortcut for calling a method on a PyObject from Java.
|
PyObject |
invoke(java.lang.String name,
PyObject arg1,
PyObject arg2)
Shortcut for calling a method on a PyObject with two args.
|
PyObject |
invoke(java.lang.String name,
PyObject arg1,
PyObject[] args,
java.lang.String[] keywords)
Shortcut for calling a method on a PyObject with one extra initial argument.
|
boolean |
isCallable() |
boolean |
isDataDescr() |
boolean |
isIndex()
Determine if this object can act as an index (implements __index__).
|
boolean |
isInteger()
Determine if this object can act as an int (implements __int__).
|
boolean |
isMappingType() |
boolean |
isNumberType() |
boolean |
isSequenceType() |
void |
noAttributeError(java.lang.String name) |
static PyObject |
object___subclasshook__(PyType type,
PyObject subclass) |
void |
readonlyAttributeError(java.lang.String name) |
void |
setDict(PyObject newDict) |
void |
setType(PyType type) |
java.lang.String |
toString() |
public static final PyType TYPE
public static boolean gcMonitorGlobal
gc
, but that would cause a
dependency cycle in the init-phases of gc.class
and PyObject.class
. Now this
boolean mirrors the presence of the gc.MONITOR_GLOBAL
-flag in
Jython's gc module.public PyObject(PyType objtype)
public PyObject()
PyObject
. It will set the objtype
field to correspond to the specific subclass of PyObject
being instantiated.public PyType getType()
public void setType(PyType type)
public void delType()
public PyObject fastGetClass()
public void dispatch__init__(PyObject[] args, java.lang.String[] keywords)
public PyString __repr__()
__repr__
method. Each sub-class of
PyObject
is likely to re-define this method to provide for its own reproduction.public java.lang.String toString()
toString
in class java.lang.Object
public PyString __str__()
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.public void __ensure_finalizer__()
org.python.core.finalization.HasFinalizeTrigger
shall
implement this method via:FinalizeTrigger.ensureFinalizer(this);
public PyUnicode __unicode__()
public final PyInteger __hash__()
hashCode
method to return an
appropriate hash code for the PyObject
.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object ob_other)
a.equals(b) == true
iff cmp(a,b) == 0
equals
in class java.lang.Object
public boolean __nonzero__()
PyObject
is considered true.public java.lang.Object __tojava__(java.lang.Class<?> c)
Py.NoConversion
if this
PyObject
can not be converted to the desired Java class.c
- the Class to convert this PyObject
to.public PyObject __call__(PyObject[] args, java.lang.String[] keywords)
args
- all arguments to the function (including keyword arguments).keywords
- the keywords used for all keyword arguments.public PyObject __call__(ThreadState state, PyObject[] args, java.lang.String[] keywords)
public PyObject __call__(PyObject arg1, PyObject[] args, java.lang.String[] keywords)
__call__(args, keywords)
with the appropriate
arguments. The only reason to override this function would be for improved performance.arg1
- the first argument to the function.args
- the last arguments to the function (including keyword arguments).keywords
- the keywords used for all keyword arguments.public PyObject __call__(ThreadState state, PyObject arg1, PyObject[] args, java.lang.String[] keywords)
public PyObject __call__(PyObject[] args)
__call__(args, keywords)
with the appropriate arguments. The only reason
to override this function would be for improved performance.args
- all arguments to the function.public PyObject __call__(ThreadState state, PyObject[] args)
public PyObject __call__()
__call__(args, keywords)
with the appropriate arguments. The only reason to
override this function would be for improved performance.public PyObject __call__(ThreadState state)
public PyObject __call__(PyObject arg0)
__call__(args, keywords)
with the appropriate arguments. The only reason to
override this function would be for improved performance.arg0
- the single argument to the function.public PyObject __call__(ThreadState state, PyObject arg0)
public PyObject __call__(PyObject arg0, PyObject arg1)
__call__(args, keywords)
with the appropriate arguments. The only reason to
override this function would be for improved performance.arg0
- the first argument to the function.arg1
- the second argument to the function.public PyObject __call__(ThreadState state, PyObject arg0, PyObject arg1)
public PyObject __call__(PyObject arg0, PyObject arg1, PyObject arg2)
__call__(args, keywords)
with the appropriate arguments. The only reason to
override this function would be for improved performance.arg0
- the first argument to the function.arg1
- the second argument to the function.arg2
- the third argument to the function.public PyObject __call__(ThreadState state, PyObject arg0, PyObject arg1, PyObject arg2)
public PyObject __call__(PyObject arg0, PyObject arg1, PyObject arg2, PyObject arg3)
__call__(args, keywords)
with the appropriate arguments. The only reason to
override this function would be for improved performance.arg0
- the first argument to the function.arg1
- the second argument to the function.arg2
- the third argument to the function.arg3
- the fourth argument to the function.public PyObject __call__(ThreadState state, PyObject arg0, PyObject arg1, PyObject arg2, PyObject arg3)
public PyObject _callextra(PyObject[] args, java.lang.String[] keywords, PyObject starargs, PyObject kwargs)
public boolean isCallable()
public boolean isNumberType()
public boolean isMappingType()
public boolean isSequenceType()
public boolean isInteger()
public boolean isIndex()
public int __len__()
public PyObject __finditem__(PyObject key)
key
- the key to lookup in this containerpublic PyObject __finditem__(int key)
int
as the key.
By default, this method will call __finditem__(PyObject key)
with the
appropriate args. The only reason to override this method is for performance.key
- the key to lookup in this sequence.__finditem__(PyObject)
public PyObject __finditem__(java.lang.String key)
String
as the key. By
default, this method will call __finditem__(PyObject key)
with the appropriate
args. The only reason to override this method is for performance.
Warning: key must be an interned string!!!!!!!!key
- the key to lookup in this sequence - must be an interned string .__finditem__(PyObject)
public PyObject __getitem__(int key)
int
as the key. This method should not be overridden. Override the
__finditem__
method instead.key
- the key to lookup in this container.PyException
- KeyError
if the key is not found.__finditem__(int)
public PyObject __getitem__(PyObject key)
__finditem__
method instead.key
- the key to lookup in this container.PyException
- KeyError
if the key is not found.__finditem__(PyObject)
public void __setitem__(PyObject key, PyObject value)
key
- the key whose value will be setvalue
- the value to set this key topublic void __setitem__(java.lang.String key, PyObject value)
__setitem__(PyObject key, PyObject value)
with the appropriate args. The only
reason to override this method is for performance.key
- the key whose value will be set - must be an interned string .value
- the value to set this key to__setitem__(PyObject, PyObject)
public void __setitem__(int key, PyObject value)
int
as the key. By
default, this will call __setitem__(PyObject key, PyObject value)
with the
appropriate args. The only reason to override this method is for performance.key
- the key whose value will be setvalue
- the value to set this key to__setitem__(PyObject, PyObject)
public void __delitem__(PyObject key)
key
- the key to be removed from the containerPyException
- KeyError
if the key is not found in the containerpublic void __delitem__(java.lang.String key)
__delitem__(PyObject key)
with the
appropriate args. The only reason to override this method is for performance.key
- the key who will be removed - must be an interned string .PyException
- KeyError
if the key is not found in the container__delitem__(PyObject)
public void __setslice__(PyObject s_start, PyObject s_stop, PyObject s_step, PyObject value)
public PyObject __iter__()
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 }
public java.lang.Iterable<PyObject> asIterable()
public PyObject __iternext__()
public final PyObject __findattr__(PyString name)
__findattr__(name.internedString)
with the
appropriate args.name
- the name to lookup in this namespacepublic final PyObject __findattr__(java.lang.String name)
String
as the name.
Warning: name must be an interned string!name
- the name to lookup in this namespace must be an interned string.public PyObject __findattr_ex__(java.lang.String name)
__getattr__(String)
or __findattr__(String)
. Both
methods have a clear policy for failed lookups.PyException
- AttributeError
if the attribute is not found. This is not
mandatory, null can be returned if it fits the implementation better, or for
performance reasons.public final PyObject __getattr__(PyString name)
__getattr__(name.internedString)
with the
appropriate args.name
- the name to lookup in this namespacePyException
- AttributeError
if the name is not found.__findattr_ex__(String)
public final PyObject __getattr__(java.lang.String name)
String
as the name.
This method can not be overridden. Override the __findattr_ex__
method instead.
Warning: name must be an interned string!!!!!!!!name
- the name to lookup in this namespace must be an interned string .PyException
- AttributeError
if the name is not found.__findattr__(java.lang.String)
public void noAttributeError(java.lang.String name)
public void readonlyAttributeError(java.lang.String name)
public final void __setattr__(PyString name, PyObject value)
name
- the name to lookup in this namespacePyException
- AttributeError
if the name is not found.__setattr__(java.lang.String, PyObject)
public void __setattr__(java.lang.String name, PyObject value)
name
- the name whose value will be set - must be an interned string .value
- the value to set this name to__setattr__(PyString, PyObject)
public final void __delattr__(PyString name)
name
- the name to which will be removedPyException
- AttributeError
if the name doesn't exist__delattr__(java.lang.String)
public void __delattr__(java.lang.String name)
__delattr__(PyString name)
with the
appropriate args. The only reason to override this method is for performance.name
- the name which will be removed - must be an interned string .PyException
- AttributeError
if the name doesn't exist__delattr__(PyString)
public PyObject __dir__()
public java.lang.Object __coerce_ex__(PyObject o)
o
- the other object involved in the coercionpublic final PyObject __coerce__(PyObject pyo)
pyo
- the other object involved in the coercion.__coerce_ex__(org.python.core.PyObject)
public int __cmp__(PyObject other)
other
- the object to compare this with.this<o
; 0 if this==o
; +1 if this>o
; -2 if no comparison
is implementedpublic PyObject __eq__(PyObject other)
other
- the object to compare this with.public PyObject __ne__(PyObject other)
other
- the object to compare this with.public PyObject __le__(PyObject other)
other
- the object to compare this with.public PyObject __lt__(PyObject other)
other
- the object to compare this with.public PyObject __ge__(PyObject other)
other
- the object to compare this with.public PyObject __gt__(PyObject other)
other
- the object to compare this with.public final int _cmp(PyObject o)
o
- the object to compare this with.this<0
; 0 if this==o
; +1 if this>o
public final PyObject _eq(PyObject o)
this == other
.o
- the object to compare this with.public final PyObject _ne(PyObject o)
this != other
.o
- the object to compare this with.public final PyObject _le(PyObject o)
this <= other
.o
- the object to compare this with.public final PyObject _lt(PyObject o)
this < other
.o
- the object to compare this with.public final PyObject _ge(PyObject o)
this >= other
.o
- the object to compare this with.public final PyObject _gt(PyObject o)
this > other
.o
- the object to compare this with.public PyObject _is(PyObject o)
is
operator.o
- the object to compare this with.public PyObject _isnot(PyObject o)
is not
operator.o
- the object to compare this with.public final PyObject _in(PyObject o)
in
operator.o
- the container to search for this element.public final PyObject _notin(PyObject o)
not in
operator.o
- the container to search for this element.public boolean __contains__(PyObject o)
o
- the element to search for in this container.public PyObject __not__()
public PyString __hex__()
public PyString __oct__()
public PyObject __int__()
public PyObject __long__()
public PyFloat __float__()
public PyComplex __complex__()
public PyObject __trunc__()
public PyObject conjugate()
public int bit_length()
public PyObject __pos__()
public PyObject __neg__()
public PyObject __abs__()
public PyObject __invert__()
public PyObject __index__()
PyException
- TypeError
if not supportedpublic PyObject __pow__(PyObject o2, PyObject o3)
o2
- the power to raise this number to.o3
- the modulus to perform this operation in or null if no modulo is to be usedpublic PyObject __add__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __radd__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __iadd__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _add(PyObject o2)
this + o2
.o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _iadd(PyObject o2)
this += o2
.o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __sub__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rsub__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __isub__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _sub(PyObject o2)
this - o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _isub(PyObject o2)
this -= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __mul__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rmul__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __imul__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _mul(PyObject o2)
this * o2
.o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _imul(PyObject o2)
this *= o2
.o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __div__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rdiv__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __idiv__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _div(PyObject o2)
this / o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _idiv(PyObject o2)
this /= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __floordiv__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rfloordiv__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __ifloordiv__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _floordiv(PyObject o2)
this // o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _ifloordiv(PyObject o2)
this //= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __truediv__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rtruediv__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __itruediv__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _truediv(PyObject o2)
this / o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _itruediv(PyObject o2)
this /= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __mod__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rmod__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __imod__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _mod(PyObject o2)
this % o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _imod(PyObject o2)
this %= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __divmod__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rdivmod__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __idivmod__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _divmod(PyObject o2)
this divmod o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _idivmod(PyObject o2)
this divmod= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __pow__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rpow__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __ipow__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _pow(PyObject o2)
this ** o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _ipow(PyObject o2)
this **= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __lshift__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rlshift__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __ilshift__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _lshift(PyObject o2)
this << o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _ilshift(PyObject o2)
this <<= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __rshift__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rrshift__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __irshift__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _rshift(PyObject o2)
this >> o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _irshift(PyObject o2)
this >>= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __and__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rand__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __iand__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _and(PyObject o2)
this & o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _iand(PyObject o2)
this &= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __or__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __ror__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __ior__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _or(PyObject o2)
this | o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _ior(PyObject o2)
this |= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject __xor__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public PyObject __rxor__(PyObject other)
other
- the object to perform this binary operation with (the left-hand operand).public PyObject __ixor__(PyObject other)
other
- the object to perform this binary operation with (the right-hand operand).public final PyObject _xor(PyObject o2)
this ^ o2
o2
- the object to perform this binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public final PyObject _ixor(PyObject o2)
this ^= o2
o2
- the object to perform this inplace binary operation with.PyException
- TypeError
if this operation can't be performed with these
operands.public PyObject _jcallexc(java.lang.Object[] args) throws java.lang.Throwable
java.lang.Throwable
public void _jthrow(java.lang.Throwable t)
public PyObject _jcall(java.lang.Object[] args)
public PyObject invoke(java.lang.String name, PyObject[] args, java.lang.String[] keywords)
name
- the name of the method to call. This must be an interned string!args
- an array of the arguments to the call.keywords
- the keywords to use in the call.public PyObject invoke(java.lang.String name)
name
- the name of the method to call. This must be an interned string!public PyObject invoke(java.lang.String name, PyObject arg1)
name
- the name of the method to call. This must be an interned string!arg1
- the one argument of the method.public PyObject invoke(java.lang.String name, PyObject arg1, PyObject arg2)
name
- the name of the method to call. This must be an interned string!arg1
- the first argument of the method.arg2
- the second argument of the method.public PyObject invoke(java.lang.String name, PyObject arg1, PyObject[] args, java.lang.String[] keywords)
name
- the name of the method to call. This must be an interned string!arg1
- the first argument of the method.args
- an array of the arguments to the call.keywords
- the keywords to use in the call.public PyObject fastGetDict()
public PyObject getDict()
public void setDict(PyObject newDict)
public void delDict()
public boolean implementsDescrGet()
public boolean implementsDescrSet()
public boolean implementsDescrDelete()
public boolean isDataDescr()
public PyObject __get__(PyObject obj, PyObject type)
obj
- - the instance accessing this descriptor. Can be null if this is being accessed by
a type.type
- - the type accessing this descriptor. Will be null if obj exists as obj is of the
type accessing the descriptor.public void __delete__(PyObject obj)
public static final java.lang.String asName(PyObject obj)
public PyObject __reduce__()
public PyObject __reduce_ex__(int arg)
arg
- PyInteger specifying reduce algorithm (method without this argument defaults to
0).public PyObject __reduce_ex__()
public PyTuple __getnewargs__()
public static PyObject object___subclasshook__(PyType type, PyObject subclass)
public java.lang.String asString(int index) throws PyObject.ConversionException
PyObject.ConversionException
public java.lang.String asString()
public java.lang.String asStringOrNull(int index) throws PyObject.ConversionException
PyObject.ConversionException
public java.lang.String asStringOrNull()
public java.lang.String asName(int index) throws PyObject.ConversionException
PyObject.ConversionException
public int asInt(int index) throws PyObject.ConversionException
PyObject.ConversionException
public int asInt()
public long asLong(int index) throws PyObject.ConversionException
PyObject.ConversionException
public long asLong()
public double asDouble()
public int asIndex()
public int asIndex(PyObject err)
err
- the Python exception to raise on OverflowErrors