MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / Call

Method Call

pkg/filament/cpython/object.go:366–380  ·  view source on GitHub ↗

Call calls a callable Python object with arguments given by the tuple args. If no arguments are needed, then args may be NULL. Returns the result of the call on success, or a null reference on failure.

(args ...*PyObject)

Source from the content-addressed store, hash-verified

364// Call calls a callable Python object with arguments given by the tuple args. If no arguments are needed, then args
365// may be NULL. Returns the result of the call on success, or a null reference on failure.
366func (ob *PyObject) Call(args ...*PyObject) *PyObject {
367 if ob.rawptr == nil {
368 return nil
369 }
370 if len(args) == 0 {
371 return &PyObject{rawptr: C.PyObject_CallObject(ob.rawptr, nil)}
372 }
373 tuple := NewTuple(len(args))
374 for pos, arg := range args {
375 tuple.Set(pos, arg)
376 }
377 defer tuple.DecRef()
378 r := C.PyObject_CallObject(ob.rawptr, tuple.rawptr)
379 return &PyObject{rawptr: r}
380}

Callers

nothing calls this directly

Calls 3

SetMethod · 0.95
NewTupleFunction · 0.85
DecRefMethod · 0.80

Tested by

no test coverage detected