Exemplo n.º 1
0
func NewMethodObj(function, self, class Object) (*MethodObj, error) {
	ret := C.PyMethod_New(c(function), c(self), c(class))
	if ret == nil {
		return nil, exception()
	}
	return newMethod(ret), nil
}
Exemplo n.º 2
0
// PyObject* PyMethod_New(PyObject *func, PyObject *self, PyObject *class)
// Return value: New reference.
// Return a new method object, with func being any callable object; this is the function that will be called when the method is called. If this method should be bound to an instance, self should be the instance and class should be the class of self, otherwise self should be NULL and class should be the class which provides the unbound method..
func PyMethod_New(fct, self, class *PyObject) *PyObject {
	return togo(C.PyMethod_New(topy(fct), topy(self), topy(class)))
}