Python.Runtime.MethodObject.GetDocString C# (CSharp) 메소드

GetDocString() 개인적인 메소드

private GetDocString ( ) : IntPtr
리턴 System.IntPtr
	internal IntPtr GetDocString() {
	    if (doc != IntPtr.Zero) {
		return doc;
	    }
	    MethodBase[] methods = binder.GetMethods();
	    string str = "";
	    for (int i = 0; i < methods.Length; i++) {
		if (str.Length > 0)
		    str += Environment.NewLine;
		str += methods[i].ToString();
	    }
	    doc = Runtime.PyString_FromString(str);
	    return doc;
	}

Usage Example

        //====================================================================
        // Descriptor __getattribute__ implementation.
        //====================================================================

        public static IntPtr tp_getattro(IntPtr ob, IntPtr key)
        {
            MethodObject self = (MethodObject)GetManagedObject(ob);

            if (!Runtime.PyString_Check(key))
            {
                return(Exceptions.RaiseTypeError("string expected"));
            }

            string name = Runtime.GetManagedString(key);

            if (name == "__doc__")
            {
                IntPtr doc = self.GetDocString();
                Runtime.Incref(doc);
                return(doc);
            }

            return(Runtime.PyObject_GenericGetAttr(ob, key));
        }