Ejemplo n.º 1
0
        /// <summary>
        /// Invoke Method
        /// </summary>
        /// <remarks>
        /// Invoke the callable object with the given arguments, passed as a
        /// PyObject[]. A PythonException is raised if the invokation fails.
        /// </remarks>
        public PyObject Invoke(params PyObject[] args)
        {
            var    t = new PyTuple(args);
            IntPtr r = Runtime.PyObject_Call(obj, t.obj, IntPtr.Zero);

            t.Dispose();
            if (r == IntPtr.Zero)
            {
                throw new PythonException();
            }
            return(new PyObject(r));
        }