Beispiel #1
0
// Call calls obj with the given args and kwds.  kwds may be nil, args may not
// (an empty Tuple must be used if no arguments are wanted).  Returns the result
// of the call, or an Error on failure.  This is equivalent to
// "obj(*args, **kwds)" in Python.
//
// Return value: New Reference.
func (obj *BaseObject) Call(args *Tuple, kwds *Dict) (Object, error) {
	ret := C.PyObject_Call(c(obj), c(args), c(kwds))
	return obj2ObjErr(ret)
}
Beispiel #2
0
// Call calls obj with the given args and kwds.  kwds may be nil, args may not
// (an empty Tuple must be used if no arguments are wanted).  Returns the result
// of the call, or an Error on failure.  This is equivalent to
// "obj(*args, **kwds)" in Python.
//
// Return value: New Reference.
func (obj *Base) Call(args *Tuple, kwds *Dict) (*Base, error) {
	ret := C.PyObject_Call(obj.c(), args.c(), kwds.c())
	return obj2ObjErr(ret)
}
Beispiel #3
0
// PyObject* PyObject_Call(PyObject *callable_object, PyObject *args, PyObject *kw)
// Return value: New reference.
// Call a callable Python object callable_object, with arguments given by the tuple args, and named arguments given by the dictionary kw. If no named arguments are needed, kw may be NULL. args must not be NULL, use an empty tuple if no arguments are needed. Returns the result of the call on success, or NULL on failure. This is the equivalent of the Python expression apply(callable_object, args, kw) or callable_object(*args, **kw).
func (self *PyObject) Call(args, kw *PyObject) *PyObject {
	return togo(C.PyObject_Call(self.ptr, args.ptr, kw.ptr))
}