Наследование: IronPython.Runtime.Types.PythonTypeSlot, IWeakReferenceable, IMembersList, IDynamicObject, ICodeFormattable
Пример #1
0
 StoreTyped(Method meth)
 {
     uint size = (uint)Marshal.SizeOf(typeof(PyMethodObject));
     IntPtr methPtr = this.allocator.Alloc(size);
     CPyMarshal.Zero(methPtr, size);
     
     CPyMarshal.WriteIntField(methPtr, typeof(PyMethodObject), "ob_refcnt", 1);
     CPyMarshal.WritePtrField(methPtr, typeof(PyMethodObject), "ob_type", this.PyMethod_Type);
     CPyMarshal.WritePtrField(methPtr, typeof(PyMethodObject), "im_func", this.Store(meth.im_func));
     CPyMarshal.WritePtrField(methPtr, typeof(PyMethodObject), "im_self", this.Store(meth.im_self));
     CPyMarshal.WritePtrField(methPtr, typeof(PyMethodObject), "im_class", this.Store(meth.im_class));
     
     this.map.Associate(methPtr, meth);
     return methPtr;
 }
Пример #2
0
 internal override bool TryGetValue(CodeContext context, object instance, PythonType owner, out object value) {
     if (this.im_self == null) {
         if (owner == null || owner == im_class || PythonOps.IsSubClass(context, owner, im_class)) {
             value = new Method(_func, instance, owner);
             return true;
         }
     }
     value = this;
     return true;
 }
Пример #3
0
 internal override bool TryGetValue(CodeContext context, object instance, PythonType owner, out object value) {
     value = new Method(this, instance, owner);
     return true;
 }
Пример #4
0
 internal override bool TryGetValue(CodeContext context, object instance, PythonType owner, out object value)
 {
     value = new Method(this, instance, owner);
     return(true);
 }
Пример #5
0
 internal override bool TryGetValue(CodeContext context, object instance, PythonType owner, out object value) {
     owner = CheckGetArgs(context, instance, owner);
     value = new Method(_func, owner, DynamicHelpers.GetPythonType(owner));
     return true;
 }
Пример #6
0
 internal override bool TryGetValue(CodeContext context, object instance, PythonType owner, out object value)
 {
     owner = CheckGetArgs(context, instance, owner);
     value = new Method(_func, owner, DynamicHelpers.GetPythonType(owner));
     return(true);
 }