Ejemplo n.º 1
0
        private static object RichEqualsHelper(object self, object other)
        {
            object res;

            if (PythonTypeOps.TryInvokeBinaryOperator(DefaultContext.Default, self, other, "__eq__", out res))
            {
                return(res);
            }

            return(NotImplementedType.Value);
        }
Ejemplo n.º 2
0
 public static object __ne__(CodeContext context, object self, object other)
 {
     if (PythonTypeOps.TryInvokeBinaryOperator(context, self, other, "__eq__", out object res))
     {
         if (res is NotImplementedType)
         {
             return(NotImplementedType.Value);
         }
         return(!PythonOps.IsTrue(res));
     }
     return(NotImplementedType.Value);
 }