Commits

masklinn committed b05c2ff

Use API and helpers in a few more places

Comments (0)

Files changed (1)

             return (this === other) ? py.True : py.False;
         },
         __ne__: function (other) {
-            if (this.__eq__(other) === py.True) {
+            if (py.PY_isTrue(this.__eq__(other))) {
                 return py.False;
             } else {
                 return py.True;
             return this.__unicode__();
         },
         __unicode__: function () {
-            return py.str.fromJSON('<' + this.__class__.__name__ + ' object>');
+            return py.str.fromJSON('<' + typename(this) + ' object>');
         },
         __nonzero__: function () {
             return py.True;
         case 'in':
             return b.__contains__(a);
         case 'not in':
-            return b.__contains__(a) === py.True ? py.False : py.True;
+            return py.PY_isTrue(b.__contains__(a)) ? py.False : py.True;
         case '==': case '!=': case '<>':
         case '<': case '<=':
         case '>': case '>=':
                     expr.operators[i],
                     left,
                     left = py.evaluate(expr.expressions[i+1], context));
-                if (result === py.False) { return py.False; }
+                if (py.PY_not(result)) { return py.False; }
             }
             return py.True;
         case 'not':
             return py.PY_isTrue(py.evaluate(expr.first, context)) ? py.False : py.True;
         case 'and':
             var and_first = py.evaluate(expr.first, context);
-            if (and_first.__nonzero__() === py.True) {
+            if (py.PY_isTrue(and_first.__nonzero__())) {
                 return py.evaluate(expr.second, context);
             }
             return and_first;
         case 'or':
             var or_first = py.evaluate(expr.first, context);
-            if (or_first.__nonzero__() === py.True) {
+            if (py.PY_isTrue(or_first.__nonzero__())) {
                 return or_first
             }
             return py.evaluate(expr.second, context);