Esempio n. 1
0
        /// <summary>
        /// Looks up a __xyz__ method in slots only (because we should never lookup
        /// in instance members for these)
        /// </summary>
        internal static bool TryLookupSpecialMethod(ICallerContext context, object self, SymbolId symbol, out object ret)
        {
            IDynamicObject ido = self as IDynamicObject;

            if (ido != null)
            {
                PythonType pt = (PythonType)ido.GetDynamicType();

                if (pt.TryLookupSlot(context, symbol, out ret))
                {
                    ret = Ops.GetDescriptor(ret, self, pt);
                    return(true);
                }
            }
            ret = null;
            return(false);
        }