Top Description Fields Constructors Methods
org.python.core

public Class PySuper

extends PyObject
implements Traverseproc
Class Inheritance
All Implemented Interfaces
org.python.core.Traverseproc
Known Direct Subclasses
org.python.core.PySuperDerived
Annotations
@ExposedType
name:super
doc:super(type) -> unbound super object super(type, obj) -> bound super object; requires isinstance(obj, type) super(type, type2) -> bound super object; requires issubclass(type2, type) Typical use to call a cooperative superclass method: class C(B): def meth(self, arg): super(C, self).meth(arg)
Imports
org.python.expose.ExposedGet, .ExposedMethod, .ExposedNew, .ExposedType

The Python super type.

Field Summary

Modifier and TypeField and Description
protected PyObject
protected PyType
protected PyType
public static final PyType
Inherited from org.python.core.PyObject:
attributesgcMonitorGlobalobjtype

Constructor Summary

AccessConstructor and Description
public
public
PySuper(PyType subType)

Method Summary

Modifier and TypeMethod and Description
public PyObject
__findattr_ex__(String name)

Overrides org.python.core.PyObject.__findattr_ex__.

Attribute lookup hook.

public PyObject
__get__(PyObject
- the instance accessing this descriptor. Can be null if this is being accessed by a type.
obj
,
PyObject
- the type accessing this descriptor. Will be null if obj exists as obj is of the type accessing the descriptor.
type
)

Overrides org.python.core.PyObject.__get__.

Get descriptor for this PyObject.

public PyObject
public PyType
public PyType
public boolean
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
public void
super___init__(PyObject[] args, String[] keywords)

private PyType

Returns:

a PyType superType
supercheck
(PyType
the PyType superType associated with the super
type
,
PyObject
a the PyObject obj associated with the super
obj
)

Check that a super() call makes sense.

public String
toString()

Overrides org.python.core.PyObject.toString.

Returns a string representation of the object.

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

Field Detail

objback to summary
protected PyObject obj
Annotations
@ExposedGet
name:__self__
doc:the instance invoking super(); may be None
objTypeback to summary
protected PyType objType
Annotations
@ExposedGet
name:__self_class__
doc:the type of the instance invoking super(); may be None
superTypeback to summary
protected PyType superType
Annotations
@ExposedGet
name:__thisclass__
doc:the class invoking super()
TYPEback to summary
public static final PyType TYPE

Hides org.python.core.PyObject.TYPE.

Constructor Detail

PySuperback to summary
public PySuper()
PySuperback to summary
public PySuper(PyType subType)

Method Detail

__findattr_ex__back to summary
public PyObject __findattr_ex__(String name)

Overrides org.python.core.PyObject.__findattr_ex__.

Doc from org.python.core.PyObject.__findattr_ex__.

Attribute lookup hook. If the attribute is not found, null may be returned or a Py.AttributeError can be thrown, whatever is more correct, efficient and/or convenient for the implementing class. Client code should use __getattr__(String) or __findattr__(String). Both methods have a clear policy for failed lookups.

Returns:PyObject

The looked up value. May return null if the attribute is not found

__get__back to summary
public PyObject __get__(PyObject obj, PyObject type)

Overrides org.python.core.PyObject.__get__.

Doc from org.python.core.PyObject.__get__.

Get descriptor for this PyObject.

Parameters
obj:PyObject

- the instance accessing this descriptor. Can be null if this is being accessed by a type.

type:PyObject

- the type accessing this descriptor. Will be null if obj exists as obj is of the type accessing the descriptor.

Returns:PyObject

- the object defined for this descriptor for the given obj and type.

getObjback to summary
public PyObject getObj()
getObjTypeback to summary
public PyType getObjType()
getSuperTypeback to summary
public PyType getSuperType()
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
super___findattr_ex__back to summary
pack-priv final PyObject super___findattr_ex__(String name)
super___get__back to summary
pack-priv final PyObject super___get__(PyObject obj, PyObject type)
Annotations
@ExposedMethod
defaults:null
doc:descr.__get__(obj[, type]) -> value
super___getattribute__back to summary
pack-priv final PyObject super___getattribute__(PyObject name)
Annotations
@ExposedMethod
doc:x.__getattribute__(\'name\') <==> x.name
super___init__back to summary
public void super___init__(PyObject[] args, String[] keywords)
Annotations
@ExposedMethod
@ExposedNew
supercheckback to summary
private PyType supercheck(PyType type, PyObject obj)

Check that a super() call makes sense. Return a type object. obj can be a new-style class, or an instance of one: - If it is a class, it must be a subclass of 'type'. This case is used for class methods; the return value is obj. - If it is an instance, it must be an instance of 'type'. This is the normal case; the return value is obj.__class__. But... when obj is an instance, we want to allow for the case where objType is not a subclass of type, but obj.__class__ is! This will allow using super() with a proxy for obj.

Parameters
type:PyType

the PyType superType associated with the super

obj:PyObject

a the PyObject obj associated with the super

Returns:PyType

a PyType superType

toStringback to summary
public String toString()

Overrides org.python.core.PyObject.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

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