types.MethodWrapperType
(seen also as
<class 'method-wrapper'>
) represents a special method
bound to a particular target "self" object. It is part of the
mechanism which allows a special method defined in Java to be
called from Python using its name as an attribute.
An example from the wild is to evaluate: (42).__add__
,
binding the method __add__
to the target 42
, to
produce a callable equivalent to λ x . 42+x. An instance
of this class results from a call to
PyWrapperDescr#__get__(Object, PyType)
.
Modifier and Type | Field and Description |
---|---|
pack-priv PyWrapperDescr | descr
Descriptor for the method being bound. |
pack-priv final Object | |
pack-priv static final PyType |
Access | Constructor and Description |
---|---|
pack-priv | PyMethodWrapper(PyWrapperDescr
for the special method to bind descr, Object to which this method call is bound self)Bind a slot wrapper descriptor to its target. |
Modifier and Type | Method and Description |
---|---|
public Object | |
protected Object | |
protected Object | |
protected int | |
protected Object | |
protected Object | |
protected Object | |
protected Object | |
protected Object | |
protected Object | |
public Object | call(Object[]
all arguments given, positional then keyword args, String[] of keyword arguments or names)null Implements org. Object[] and String[] ), providing all the
argument values from the caller and names for those given by
keyword.
|
public PyType | getType()
Overrides org. Implements org. type of this object.
|
public TypeError | typeError(ArgumentError
previously thrown by this object ae, Object[] all arguments given, positional then keyword args, String[] of keyword arguments or names)null Implements org. ArgumentError that resulted from a call to
this FastCall object, and the arguments that were
supplied in the call, to a Python TypeError .
|
descr | back to summary |
---|---|
pack-priv PyWrapperDescr descr Descriptor for the method being bound. |
self | back to summary |
---|---|
pack-priv final Object self The target object of the method call that results when
|
TYPE | back to summary |
---|---|
pack-priv static final PyType TYPE |
PyMethodWrapper | back to summary |
---|---|
pack-priv PyMethodWrapper(PyWrapperDescr descr, Object self) Bind a slot wrapper descriptor to its target. The result is a
callable object e.g. in
|
__call__ | back to summary |
---|---|
public Object __call__(Object[] args, String[] names) throws Throwable |
__doc__ | back to summary |
---|---|
protected Object __doc__() |
__eq__ | back to summary |
---|---|
protected Object __eq__(Object b) |
__hash__ | back to summary |
---|---|
protected int __hash__() |
__name__ | back to summary |
---|---|
protected Object __name__() |
__ne__ | back to summary |
---|---|
protected Object __ne__(Object b) |
__objclass__ | back to summary |
---|---|
protected Object __objclass__() |
__qualname__ | back to summary |
---|---|
protected Object __qualname__() throws AttributeError, Throwable |
__repr__ | back to summary |
---|---|
protected Object __repr__() |
__text_signature__ | back to summary |
---|---|
protected Object __text_signature__() |
call | back to summary |
---|---|
public Object call(Object[] args, String[] names) throws Throwable Implements org. Doc from org. Invoke the target object with standard arguments
(
|
getType | back to summary |
---|---|
public PyType getType() Overrides org. Implements org. Doc from org. The Python |
typeError | back to summary |
---|---|
public TypeError typeError(ArgumentError ae, Object[] args, String[] names) Implements org. Doc from org. Translate an
Any of the optimised
|