Python.Runtime.ConstructorBinding.mp_subscript C# (CSharp) Метод

mp_subscript() публичный статический Метод

ConstructorBinding.GetItem(PyObject *o, PyObject *key) Return element of o corresponding to the object key or NULL on failure. This is the equivalent of the Python expression o[key].
public static mp_subscript ( IntPtr op, IntPtr key ) : IntPtr
op System.IntPtr
key System.IntPtr
Результат System.IntPtr
        public static IntPtr mp_subscript(IntPtr op, IntPtr key)
        {
            ConstructorBinding self = (ConstructorBinding)GetManagedObject(op);

            Type[] types = Runtime.PythonArgsToTypeArray(key);
            if (types == null)
            {
                return Exceptions.RaiseTypeError("type(s) expected");
            }
            //MethodBase[] methBaseArray = self.ctorBinder.GetMethods();
            //MethodBase ci = MatchSignature(methBaseArray, types);
            ConstructorInfo ci = self.type.GetConstructor(types);
            if (ci == null)
            {
                string msg = "No match found for constructor signature";
                return Exceptions.RaiseTypeError(msg);
            }
            BoundContructor boundCtor = new BoundContructor(self.type, self.pyTypeHndl, self.ctorBinder, ci);

            /* Since nothing's chached, do we need the increment???
            Runtime.XIncref(boundCtor.pyHandle);  // Decref'd by the interpreter??? */
            return boundCtor.pyHandle;
        }