Beispiel #1
0
        public PyObject CallKeywords(PyTuple args, PyTuple kws)
        {
            if (IsInvalid || !IsCallable)
            {
                return(null);
            }

            var ret =
                PyObject_Call(Pointer, args != null ? args.Pointer : IntPtr.Zero,
                              kws != null ? kws.Pointer : IntPtr.Zero);

            return(GetSpecialized(ret));
        }
Beispiel #2
0
        public PyObject Call(params PyObject[] args)
        {
            if (IsInvalid || args == null)
            {
                return(null);
            }
            var tuple = new PyTuple(args);

            if (tuple.IsInvalid)
            {
                return(null);
            }
            if (!IsCallable)
            {
                return(null);
            }
            var ret = new PyObject(PyObject_CallObject(Pointer, tuple.Pointer));

            tuple.DecRef();
            return(ret);
        }