Ejemplo n.º 1
0
// int PyFunction_SetClosure(PyObject *op, PyObject *closure)
// Set the closure associated with the function object op. closure must be Py_None or a tuple of cell objects.
//
// Raises SystemError and returns -1 on failure.
func PyFunction_SetClosure(op, closure *PyObject) error {
	return int2err(C.PyFunction_SetClosure(topy(op), topy(closure)))
}
Ejemplo n.º 2
0
// SetClosure sets the closure associated with function "fn".  "o" must be
// either a Tuple of Cell objects, or None.
func (fn *Function) SetClosure(o Object) error {
	ret := C.PyFunction_SetClosure(c(fn), c(o))
	return int2Err(ret)
}