diff --git a/python/common/org/python/Object.java b/python/common/org/python/Object.java index 20c3a6dbeb..b01fd7623b 100644 --- a/python/common/org/python/Object.java +++ b/python/common/org/python/Object.java @@ -142,6 +142,13 @@ public interface Object { public void __itruediv__(org.python.Object other); public void __ifloordiv__(org.python.Object other); public void __imod__(org.python.Object other); + public void __idivmod__(org.python.Object other); + public void __ipow__(org.python.Object other); + public void __ilshift__(org.python.Object other); + public void __irshift__(org.python.Object other); + public void __iand__(org.python.Object other); + public void __ixor__(org.python.Object other); + public void __ior__(org.python.Object other); public org.python.Object __neg__(); public org.python.Object __pos__(); diff --git a/python/common/org/python/exceptions/BaseException.java b/python/common/org/python/exceptions/BaseException.java index 6b85f572e5..5e1c0e478d 100644 --- a/python/common/org/python/exceptions/BaseException.java +++ b/python/common/org/python/exceptions/BaseException.java @@ -435,7 +435,35 @@ public void __ifloordiv__(org.python.Object other) { } public void __imod__(org.python.Object other) { - throw new org.python.exceptions.AttributeError(this, "__im__"); + throw new org.python.exceptions.AttributeError(this, "__imod__"); + } + + public void __idivmod__(org.python.Object other) { + throw new org.python.exceptions.AttributeError(this, "__idivmod__"); + } + + public void __ipow__(org.python.Object other) { + throw new org.python.exceptions.AttributeError(this, "__ipow__"); + } + + public void __ilshift__(org.python.Object other) { + throw new org.python.exceptions.AttributeError(this, "__ilshift__"); + } + + public void __irshift__(org.python.Object other) { + throw new org.python.exceptions.AttributeError(this, "__irshift__"); + } + + public void __iand__(org.python.Object other) { + throw new org.python.exceptions.AttributeError(this, "__iand__"); + } + + public void __ixor__(org.python.Object other) { + throw new org.python.exceptions.AttributeError(this, "__ixor__"); + } + + public void __ior__(org.python.Object other) { + throw new org.python.exceptions.AttributeError(this, "__ior__"); } diff --git a/python/common/org/python/types/NotImplementedType.java b/python/common/org/python/types/NotImplementedType.java index 9def534558..ca335176cf 100644 --- a/python/common/org/python/types/NotImplementedType.java +++ b/python/common/org/python/types/NotImplementedType.java @@ -20,4 +20,90 @@ public org.python.types.Str __repr__() { public boolean __setattr_null(java.lang.String name, org.python.Object value) { return false; } + + @org.python.Method( + __doc__ = "" + ) + public org.python.Object __invert__() { + throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'NotImplementedType'"); + } + + @org.python.Method( + __doc__ = "" + ) + public org.python.Object __pos__() { + throw new org.python.exceptions.TypeError("bad operand type for unary +: 'NotImplementedType'"); + } + + @org.python.Method( + __doc__ = "" + ) + public org.python.Object __neg__() { + throw new org.python.exceptions.TypeError("bad operand type for unary -: 'NotImplementedType'"); + } + + @org.python.Method( + __doc__ = "" + ) + public org.python.types.Bool __bool__() { + return new org.python.types.Bool(true); + } + + @org.python.Method( + __doc__ = "" + ) + public org.python.Object __ge__(org.python.Object other) { + throw new org.python.exceptions.TypeError( + String.format("unorderable types: NotImplementedType() >= %s()", other.typeName()) + ); + } + + @org.python.Method( + __doc__ = "" + ) + public org.python.Object __gt__(org.python.Object other) { + throw new org.python.exceptions.TypeError( + String.format("unorderable types: NotImplementedType() > %s()", other.typeName()) + ); + } + + @org.python.Method( + __doc__ = "" + ) + public org.python.Object __lt__(org.python.Object other) { + throw new org.python.exceptions.TypeError( + String.format("unorderable types: NotImplementedType() < %s()", other.typeName()) + ); + } + + @org.python.Method( + __doc__ = "" + ) + public org.python.Object __le__(org.python.Object other) { + throw new org.python.exceptions.TypeError( + String.format("unorderable types: NotImplementedType() <= %s()", other.typeName()) + ); + } + + @org.python.Method( + __doc__ = "" + ) + public org.python.Object __mul__(org.python.Object other) { + if (other instanceof org.python.types.Str || other instanceof org.python.types.List || other instanceof org.python.types.Tuple) { + throw new org.python.exceptions.TypeError("can't multiply sequence by non-int of type 'NotImplementedType'"); + } else { + throw new org.python.exceptions.TypeError( + String.format("unsupported operand type(s) for *: 'NotImplementedType' and '%s'", + other.typeName()) + ); + } + } + + @org.python.Method( + __doc__ = "" + ) + public org.python.Object __getitem__(org.python.Object other) { + throw new org.python.exceptions.TypeError("'NotImplementedType' object is not subscriptable"); + } + } diff --git a/python/common/org/python/types/Object.java b/python/common/org/python/types/Object.java index 01bdbed3fc..8bb5afab6f 100644 --- a/python/common/org/python/types/Object.java +++ b/python/common/org/python/types/Object.java @@ -781,6 +781,19 @@ public void __imod__(org.python.Object other) { } + @org.python.Method( + __doc__ = "", + args = {"other"} + ) + public void __idivmod__(org.python.Object other) { + try { + this.setValue(this.__pow__(other, null)); + } catch (org.python.exceptions.TypeError e) { + throw new org.python.exceptions.TypeError("unsupported operand type(s) for //=: '" + this.typeName() + "' and '" + other.typeName() + "'"); + } + } + + @org.python.Method( __doc__ = "", args = {"other"} diff --git a/python/common/org/python/types/Super.java b/python/common/org/python/types/Super.java index ee9033fc67..c84eff8b9e 100644 --- a/python/common/org/python/types/Super.java +++ b/python/common/org/python/types/Super.java @@ -738,6 +738,19 @@ public void __imod__(org.python.Object other) { } + @org.python.Method( + __doc__ = "", + args = {"other"} + ) + public void __idivmod__(org.python.Object other) { + try { + this.setValue(this.__pow__(other, null)); + } catch (org.python.exceptions.TypeError e) { + throw new org.python.exceptions.TypeError("unsupported operand type(s) for //=: '" + this.typeName() + "' and '" + other.typeName() + "'"); + } + } + + @org.python.Method( __doc__ = "", args = {"other"} diff --git a/tests/datatypes/test_NoneType.py b/tests/datatypes/test_NoneType.py index 3ce4595cd3..fb79316028 100644 --- a/tests/datatypes/test_NoneType.py +++ b/tests/datatypes/test_NoneType.py @@ -153,20 +153,11 @@ class InplaceNoneTypeOperationTests(InplaceOperationTestCase, TranspileTestCase) 'test_add_complex', 'test_add_frozenset', - 'test_and_bool', 'test_and_bytearray', 'test_and_bytes', 'test_and_class', 'test_and_complex', - 'test_and_dict', - 'test_and_float', 'test_and_frozenset', - 'test_and_int', - 'test_and_list', - 'test_and_none', - 'test_and_set', - 'test_and_str', - 'test_and_tuple', 'test_floor_divide_bytearray', 'test_floor_divide_bytes', @@ -174,20 +165,11 @@ class InplaceNoneTypeOperationTests(InplaceOperationTestCase, TranspileTestCase) 'test_floor_divide_complex', 'test_floor_divide_frozenset', - 'test_lshift_bool', 'test_lshift_bytearray', 'test_lshift_bytes', 'test_lshift_class', 'test_lshift_complex', - 'test_lshift_dict', - 'test_lshift_float', 'test_lshift_frozenset', - 'test_lshift_int', - 'test_lshift_list', - 'test_lshift_none', - 'test_lshift_set', - 'test_lshift_str', - 'test_lshift_tuple', 'test_modulo_bytearray', 'test_modulo_bytes', @@ -204,20 +186,11 @@ class InplaceNoneTypeOperationTests(InplaceOperationTestCase, TranspileTestCase) 'test_multiply_str', 'test_multiply_tuple', - 'test_or_bool', 'test_or_bytearray', 'test_or_bytes', 'test_or_class', 'test_or_complex', - 'test_or_dict', - 'test_or_float', 'test_or_frozenset', - 'test_or_int', - 'test_or_list', - 'test_or_none', - 'test_or_set', - 'test_or_str', - 'test_or_tuple', 'test_power_bool', 'test_power_bytearray', @@ -234,20 +207,11 @@ class InplaceNoneTypeOperationTests(InplaceOperationTestCase, TranspileTestCase) 'test_power_str', 'test_power_tuple', - 'test_rshift_bool', 'test_rshift_bytearray', 'test_rshift_bytes', 'test_rshift_class', 'test_rshift_complex', - 'test_rshift_dict', - 'test_rshift_float', 'test_rshift_frozenset', - 'test_rshift_int', - 'test_rshift_list', - 'test_rshift_none', - 'test_rshift_set', - 'test_rshift_str', - 'test_rshift_tuple', 'test_subtract_bytearray', 'test_subtract_bytes', @@ -261,18 +225,9 @@ class InplaceNoneTypeOperationTests(InplaceOperationTestCase, TranspileTestCase) 'test_true_divide_complex', 'test_true_divide_frozenset', - 'test_xor_bool', 'test_xor_bytearray', 'test_xor_bytes', 'test_xor_class', 'test_xor_complex', - 'test_xor_dict', - 'test_xor_float', 'test_xor_frozenset', - 'test_xor_int', - 'test_xor_list', - 'test_xor_none', - 'test_xor_set', - 'test_xor_str', - 'test_xor_tuple', ] diff --git a/tests/datatypes/test_NotImplemented.py b/tests/datatypes/test_NotImplemented.py new file mode 100644 index 0000000000..dd93385036 --- /dev/null +++ b/tests/datatypes/test_NotImplemented.py @@ -0,0 +1,264 @@ +from .. utils import TranspileTestCase, UnaryOperationTestCase, BinaryOperationTestCase, InplaceOperationTestCase + +class NotImplementedTests(TranspileTestCase): + def test_truth(self): + self.assertCodeExecution(""" + x = NotImplemented + print(x == True) + """) + +class UnaryNotImplementedOperationTests(UnaryOperationTestCase, TranspileTestCase): + values = ['NotImplemented'] + + not_implemented = [ + ] + +class BinaryNotImplementedOperationTests(BinaryOperationTestCase, TranspileTestCase): + values = ['NotImplemented'] + + not_implemented = [ + 'test_add_bytearray', + 'test_add_bytes', + 'test_add_class', + 'test_add_complex', + 'test_add_frozenset', + + 'test_and_bytearray', + 'test_and_bytes', + 'test_and_class', + 'test_and_complex', + 'test_and_frozenset', + + 'test_eq_bytearray', + 'test_eq_bytes', + 'test_eq_class', + 'test_eq_complex', + 'test_eq_frozenset', + + 'test_floor_divide_bytearray', + 'test_floor_divide_bytes', + 'test_floor_divide_class', + 'test_floor_divide_complex', + 'test_floor_divide_frozenset', + + 'test_ge_bytearray', + 'test_ge_bytes', + 'test_ge_class', + 'test_ge_complex', + 'test_ge_frozenset', + + 'test_gt_bytearray', + 'test_gt_bytes', + 'test_gt_class', + 'test_gt_complex', + 'test_gt_frozenset', + + 'test_le_bytearray', + 'test_le_bytes', + 'test_le_class', + 'test_le_complex', + 'test_le_frozenset', + + 'test_lshift_bytearray', + 'test_lshift_bytes', + 'test_lshift_class', + 'test_lshift_complex', + 'test_lshift_frozenset', + + 'test_lt_bytearray', + 'test_lt_bytes', + 'test_lt_class', + 'test_lt_complex', + 'test_lt_frozenset', + + 'test_modulo_bytearray', + 'test_modulo_bytes', + 'test_modulo_class', + 'test_modulo_complex', + 'test_modulo_frozenset', + + 'test_multiply_bytearray', + 'test_multiply_bytes', + 'test_multiply_class', + 'test_multiply_complex', + 'test_multiply_frozenset', + + 'test_ne_bytearray', + 'test_ne_bytes', + 'test_ne_class', + 'test_ne_complex', + 'test_ne_frozenset', + + 'test_or_bytearray', + 'test_or_bytes', + 'test_or_class', + 'test_or_complex', + 'test_or_frozenset', + + 'test_power_bytearray', + 'test_power_bytes', + 'test_power_class', + 'test_power_complex', + 'test_power_frozenset', + + 'test_rshift_bytearray', + 'test_rshift_bytes', + 'test_rshift_class', + 'test_rshift_complex', + 'test_rshift_frozenset', + + 'test_subscr_bytearray', + 'test_subscr_bytes', + 'test_subscr_class', + 'test_subscr_complex', + 'test_subscr_frozenset', + + 'test_subtract_bytearray', + 'test_subtract_bytes', + 'test_subtract_class', + 'test_subtract_complex', + 'test_subtract_frozenset', + + 'test_true_divide_bytearray', + 'test_true_divide_bytes', + 'test_true_divide_class', + 'test_true_divide_complex', + 'test_true_divide_frozenset', + + 'test_xor_bytearray', + 'test_xor_bytes', + 'test_xor_class', + 'test_xor_complex', + 'test_xor_frozenset', + ] + +class InplaceNotImplementedOperationTests(InplaceOperationTestCase, TranspileTestCase): + values = ['NotImplemented'] + + not_implemented = [ + 'test_add_bytearray', + 'test_add_bytes', + 'test_add_class', + 'test_add_complex', + 'test_add_frozenset', + + 'test_and_bytearray', + 'test_and_bytes', + 'test_and_class', + 'test_and_complex', + 'test_and_frozenset', + + 'test_eq_bytearray', + 'test_eq_bytes', + 'test_eq_class', + 'test_eq_complex', + 'test_eq_frozenset', + + 'test_floor_divide_bytearray', + 'test_floor_divide_bytes', + 'test_floor_divide_class', + 'test_floor_divide_complex', + 'test_floor_divide_frozenset', + + 'test_ge_bytearray', + 'test_ge_bytes', + 'test_ge_class', + 'test_ge_complex', + 'test_ge_frozenset', + + 'test_gt_bytearray', + 'test_gt_bytes', + 'test_gt_class', + 'test_gt_complex', + 'test_gt_frozenset', + + 'test_le_bytearray', + 'test_le_bytes', + 'test_le_class', + 'test_le_complex', + 'test_le_frozenset', + + 'test_lshift_bytearray', + 'test_lshift_bytes', + 'test_lshift_class', + 'test_lshift_complex', + 'test_lshift_frozenset', + + 'test_lt_bytearray', + 'test_lt_bytes', + 'test_lt_class', + 'test_lt_complex', + 'test_lt_frozenset', + + 'test_modulo_bytearray', + 'test_modulo_bytes', + 'test_modulo_class', + 'test_modulo_complex', + 'test_modulo_frozenset', + + 'test_multiply_bytearray', + 'test_multiply_bytes', + 'test_multiply_class', + 'test_multiply_complex', + 'test_multiply_frozenset', + 'test_multiply_list', + 'test_multiply_str', + 'test_multiply_tuple', + + 'test_ne_bytearray', + 'test_ne_bytes', + 'test_ne_class', + 'test_ne_complex', + 'test_ne_frozenset', + + 'test_or_bytearray', + 'test_or_bytes', + 'test_or_class', + 'test_or_complex', + 'test_or_frozenset', + + 'test_power_bool', + 'test_power_bytearray', + 'test_power_bytes', + 'test_power_class', + 'test_power_complex', + 'test_power_dict', + 'test_power_float', + 'test_power_frozenset', + 'test_power_int', + 'test_power_list', + 'test_power_none', + 'test_power_set', + 'test_power_str', + 'test_power_tuple', + + 'test_rshift_bytearray', + 'test_rshift_bytes', + 'test_rshift_class', + 'test_rshift_complex', + 'test_rshift_frozenset', + + 'test_subscr_bytearray', + 'test_subscr_bytes', + 'test_subscr_class', + 'test_subscr_complex', + 'test_subscr_frozenset', + + 'test_subtract_bytearray', + 'test_subtract_bytes', + 'test_subtract_class', + 'test_subtract_complex', + 'test_subtract_frozenset', + + 'test_true_divide_bytearray', + 'test_true_divide_bytes', + 'test_true_divide_class', + 'test_true_divide_complex', + 'test_true_divide_frozenset', + + 'test_xor_bytearray', + 'test_xor_bytes', + 'test_xor_class', + 'test_xor_complex', + 'test_xor_frozenset', + ] diff --git a/tests/datatypes/test_dict.py b/tests/datatypes/test_dict.py index aa101307a7..31c1b866ae 100644 --- a/tests/datatypes/test_dict.py +++ b/tests/datatypes/test_dict.py @@ -311,20 +311,11 @@ class InplaceDictOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_add_complex', 'test_add_frozenset', - 'test_and_bool', 'test_and_bytearray', 'test_and_bytes', 'test_and_class', 'test_and_complex', - 'test_and_dict', - 'test_and_float', 'test_and_frozenset', - 'test_and_int', - 'test_and_list', - 'test_and_none', - 'test_and_set', - 'test_and_str', - 'test_and_tuple', 'test_floor_divide_bytearray', 'test_floor_divide_bytes', @@ -332,20 +323,11 @@ class InplaceDictOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_floor_divide_complex', 'test_floor_divide_frozenset', - 'test_lshift_bool', 'test_lshift_bytearray', 'test_lshift_bytes', 'test_lshift_class', 'test_lshift_complex', - 'test_lshift_dict', - 'test_lshift_float', 'test_lshift_frozenset', - 'test_lshift_int', - 'test_lshift_list', - 'test_lshift_none', - 'test_lshift_set', - 'test_lshift_str', - 'test_lshift_tuple', 'test_modulo_bytearray', 'test_modulo_bytes', @@ -359,20 +341,11 @@ class InplaceDictOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_multiply_complex', 'test_multiply_frozenset', - 'test_or_bool', 'test_or_bytearray', 'test_or_bytes', 'test_or_class', 'test_or_complex', - 'test_or_dict', - 'test_or_float', 'test_or_frozenset', - 'test_or_int', - 'test_or_list', - 'test_or_none', - 'test_or_set', - 'test_or_str', - 'test_or_tuple', 'test_power_bool', 'test_power_bytearray', @@ -389,20 +362,11 @@ class InplaceDictOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_power_str', 'test_power_tuple', - 'test_rshift_bool', 'test_rshift_bytearray', 'test_rshift_bytes', 'test_rshift_class', 'test_rshift_complex', - 'test_rshift_dict', - 'test_rshift_float', 'test_rshift_frozenset', - 'test_rshift_int', - 'test_rshift_list', - 'test_rshift_none', - 'test_rshift_set', - 'test_rshift_str', - 'test_rshift_tuple', 'test_subtract_bytearray', 'test_subtract_bytes', @@ -416,18 +380,9 @@ class InplaceDictOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_true_divide_complex', 'test_true_divide_frozenset', - 'test_xor_bool', 'test_xor_bytearray', 'test_xor_bytes', 'test_xor_class', 'test_xor_complex', - 'test_xor_dict', - 'test_xor_float', 'test_xor_frozenset', - 'test_xor_int', - 'test_xor_list', - 'test_xor_none', - 'test_xor_set', - 'test_xor_str', - 'test_xor_tuple', ] diff --git a/tests/datatypes/test_float.py b/tests/datatypes/test_float.py index 3a66bf5e3e..7e6de27aaf 100644 --- a/tests/datatypes/test_float.py +++ b/tests/datatypes/test_float.py @@ -54,7 +54,7 @@ class BinaryFloatOperationTests(BinaryOperationTestCase, TranspileTestCase): 'test_add_float', 'test_add_complex', 'test_add_frozenset', - + 'test_and_bytearray', 'test_and_bytes', 'test_and_class', @@ -96,7 +96,7 @@ class BinaryFloatOperationTests(BinaryOperationTestCase, TranspileTestCase): 'test_le_class', 'test_le_complex', 'test_le_frozenset', - + 'test_lshift_bytearray', 'test_lshift_bytes', 'test_lshift_class', @@ -194,7 +194,7 @@ class BinaryFloatOperationTests(BinaryOperationTestCase, TranspileTestCase): 'test_subtract_class', 'test_subtract_complex', 'test_subtract_frozenset', - + 'test_true_divide_bytearray', 'test_true_divide_bytes', 'test_true_divide_class', @@ -219,21 +219,12 @@ class InplaceFloatOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_add_class', 'test_add_complex', 'test_add_frozenset', - - 'test_and_bool', + 'test_and_bytearray', 'test_and_bytes', 'test_and_class', 'test_and_complex', - 'test_and_dict', - 'test_and_float', 'test_and_frozenset', - 'test_and_int', - 'test_and_list', - 'test_and_none', - 'test_and_set', - 'test_and_str', - 'test_and_tuple', 'test_floor_divide_bytearray', 'test_floor_divide_bytes', @@ -241,20 +232,11 @@ class InplaceFloatOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_floor_divide_complex', 'test_floor_divide_frozenset', - 'test_lshift_bool', 'test_lshift_bytearray', 'test_lshift_bytes', 'test_lshift_class', 'test_lshift_complex', - 'test_lshift_dict', - 'test_lshift_float', 'test_lshift_frozenset', - 'test_lshift_int', - 'test_lshift_list', - 'test_lshift_none', - 'test_lshift_set', - 'test_lshift_str', - 'test_lshift_tuple', 'test_modulo_bool', 'test_modulo_bytearray', @@ -280,22 +262,12 @@ class InplaceFloatOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_multiply_str', 'test_multiply_tuple', - 'test_or_bool', 'test_or_bytearray', 'test_or_bytes', 'test_or_class', 'test_or_complex', - 'test_or_dict', - 'test_or_float', 'test_or_frozenset', - 'test_or_int', - 'test_or_list', - 'test_or_none', - 'test_or_set', - 'test_or_str', - 'test_or_tuple', - - 'test_power_bool', + 'test_power_bytearray', 'test_power_bytes', 'test_power_class', @@ -310,20 +282,11 @@ class InplaceFloatOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_power_str', 'test_power_tuple', - 'test_rshift_bool', 'test_rshift_bytearray', 'test_rshift_bytes', 'test_rshift_class', 'test_rshift_complex', - 'test_rshift_dict', - 'test_rshift_float', 'test_rshift_frozenset', - 'test_rshift_int', - 'test_rshift_list', - 'test_rshift_none', - 'test_rshift_set', - 'test_rshift_str', - 'test_rshift_tuple', 'test_subtract_bytearray', 'test_subtract_bytes', @@ -337,18 +300,9 @@ class InplaceFloatOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_true_divide_complex', 'test_true_divide_frozenset', - 'test_xor_bool', 'test_xor_bytearray', 'test_xor_bytes', 'test_xor_class', 'test_xor_complex', - 'test_xor_dict', - 'test_xor_float', 'test_xor_frozenset', - 'test_xor_int', - 'test_xor_list', - 'test_xor_none', - 'test_xor_set', - 'test_xor_str', - 'test_xor_tuple', ] diff --git a/tests/datatypes/test_int.py b/tests/datatypes/test_int.py index 2f829e3b27..6ee13daeb5 100644 --- a/tests/datatypes/test_int.py +++ b/tests/datatypes/test_int.py @@ -156,20 +156,11 @@ class InplaceIntOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_add_frozenset', 'test_add_float', - 'test_and_bool', 'test_and_bytearray', 'test_and_bytes', 'test_and_class', 'test_and_complex', - 'test_and_dict', - 'test_and_float', 'test_and_frozenset', - 'test_and_int', - 'test_and_list', - 'test_and_none', - 'test_and_set', - 'test_and_str', - 'test_and_tuple', 'test_floor_divide_bytearray', 'test_floor_divide_bytes', @@ -178,20 +169,11 @@ class InplaceIntOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_floor_divide_frozenset', 'test_floor_divide_float', - 'test_lshift_bool', 'test_lshift_bytearray', 'test_lshift_bytes', 'test_lshift_class', 'test_lshift_complex', - 'test_lshift_dict', - 'test_lshift_float', 'test_lshift_frozenset', - 'test_lshift_int', - 'test_lshift_list', - 'test_lshift_none', - 'test_lshift_set', - 'test_lshift_str', - 'test_lshift_tuple', 'test_modulo_bytearray', 'test_modulo_bytes', @@ -210,22 +192,12 @@ class InplaceIntOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_multiply_str', 'test_multiply_tuple', - 'test_or_bool', 'test_or_bytearray', 'test_or_bytes', 'test_or_class', 'test_or_complex', - 'test_or_dict', - 'test_or_float', 'test_or_frozenset', - 'test_or_int', - 'test_or_list', - 'test_or_none', - 'test_or_set', - 'test_or_str', - 'test_or_tuple', - - 'test_power_bool', + 'test_power_bytearray', 'test_power_bytes', 'test_power_class', @@ -240,20 +212,11 @@ class InplaceIntOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_power_str', 'test_power_tuple', - 'test_rshift_bool', 'test_rshift_bytearray', 'test_rshift_bytes', 'test_rshift_class', 'test_rshift_complex', - 'test_rshift_dict', - 'test_rshift_float', 'test_rshift_frozenset', - 'test_rshift_int', - 'test_rshift_list', - 'test_rshift_none', - 'test_rshift_set', - 'test_rshift_str', - 'test_rshift_tuple', 'test_subtract_bytearray', 'test_subtract_bytes', @@ -271,18 +234,9 @@ class InplaceIntOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_true_divide_float', 'test_true_divide_int', - 'test_xor_bool', 'test_xor_bytearray', 'test_xor_bytes', 'test_xor_class', 'test_xor_complex', - 'test_xor_dict', - 'test_xor_float', 'test_xor_frozenset', - 'test_xor_int', - 'test_xor_list', - 'test_xor_none', - 'test_xor_set', - 'test_xor_str', - 'test_xor_tuple', ] diff --git a/tests/datatypes/test_list.py b/tests/datatypes/test_list.py index 7991cdc9c2..187e8d7bc1 100644 --- a/tests/datatypes/test_list.py +++ b/tests/datatypes/test_list.py @@ -197,20 +197,11 @@ class InplaceListOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_add_str', 'test_add_tuple', - 'test_and_bool', 'test_and_bytearray', 'test_and_bytes', 'test_and_class', 'test_and_complex', - 'test_and_dict', - 'test_and_float', 'test_and_frozenset', - 'test_and_int', - 'test_and_list', - 'test_and_none', - 'test_and_set', - 'test_and_str', - 'test_and_tuple', 'test_floor_divide_bytearray', 'test_floor_divide_bytes', @@ -218,20 +209,11 @@ class InplaceListOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_floor_divide_complex', 'test_floor_divide_frozenset', - 'test_lshift_bool', 'test_lshift_bytearray', 'test_lshift_bytes', 'test_lshift_class', 'test_lshift_complex', - 'test_lshift_dict', - 'test_lshift_float', 'test_lshift_frozenset', - 'test_lshift_int', - 'test_lshift_list', - 'test_lshift_none', - 'test_lshift_set', - 'test_lshift_str', - 'test_lshift_tuple', 'test_modulo_bytearray', 'test_modulo_bytes', @@ -252,20 +234,11 @@ class InplaceListOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_multiply_str', 'test_multiply_tuple', - 'test_or_bool', 'test_or_bytearray', 'test_or_bytes', 'test_or_class', 'test_or_complex', - 'test_or_dict', - 'test_or_float', 'test_or_frozenset', - 'test_or_int', - 'test_or_list', - 'test_or_none', - 'test_or_set', - 'test_or_str', - 'test_or_tuple', 'test_power_bool', 'test_power_bytearray', @@ -282,20 +255,11 @@ class InplaceListOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_power_str', 'test_power_tuple', - 'test_rshift_bool', 'test_rshift_bytearray', 'test_rshift_bytes', 'test_rshift_class', 'test_rshift_complex', - 'test_rshift_dict', - 'test_rshift_float', 'test_rshift_frozenset', - 'test_rshift_int', - 'test_rshift_list', - 'test_rshift_none', - 'test_rshift_set', - 'test_rshift_str', - 'test_rshift_tuple', 'test_subtract_bytearray', 'test_subtract_bytes', @@ -309,18 +273,9 @@ class InplaceListOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_true_divide_complex', 'test_true_divide_frozenset', - 'test_xor_bool', 'test_xor_bytearray', 'test_xor_bytes', 'test_xor_class', 'test_xor_complex', - 'test_xor_dict', - 'test_xor_float', 'test_xor_frozenset', - 'test_xor_int', - 'test_xor_list', - 'test_xor_none', - 'test_xor_set', - 'test_xor_str', - 'test_xor_tuple', ] diff --git a/tests/datatypes/test_set.py b/tests/datatypes/test_set.py index 78681f7207..dd30c53c70 100644 --- a/tests/datatypes/test_set.py +++ b/tests/datatypes/test_set.py @@ -259,20 +259,12 @@ class InplaceSetOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_add_complex', 'test_add_frozenset', - 'test_and_bool', 'test_and_bytearray', 'test_and_bytes', 'test_and_class', 'test_and_complex', - 'test_and_dict', - 'test_and_float', 'test_and_frozenset', - 'test_and_int', - 'test_and_list', - 'test_and_none', 'test_and_set', - 'test_and_str', - 'test_and_tuple', 'test_floor_divide_bytearray', 'test_floor_divide_bytes', @@ -280,20 +272,11 @@ class InplaceSetOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_floor_divide_complex', 'test_floor_divide_frozenset', - 'test_lshift_bool', 'test_lshift_bytearray', 'test_lshift_bytes', 'test_lshift_class', 'test_lshift_complex', - 'test_lshift_dict', - 'test_lshift_float', 'test_lshift_frozenset', - 'test_lshift_int', - 'test_lshift_list', - 'test_lshift_none', - 'test_lshift_set', - 'test_lshift_str', - 'test_lshift_tuple', 'test_modulo_bytearray', 'test_modulo_bytes', @@ -307,20 +290,12 @@ class InplaceSetOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_multiply_complex', 'test_multiply_frozenset', - 'test_or_bool', 'test_or_bytearray', 'test_or_bytes', 'test_or_class', 'test_or_complex', - 'test_or_dict', - 'test_or_float', 'test_or_frozenset', - 'test_or_int', - 'test_or_list', - 'test_or_none', 'test_or_set', - 'test_or_str', - 'test_or_tuple', 'test_power_bool', 'test_power_bytearray', @@ -337,20 +312,11 @@ class InplaceSetOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_power_str', 'test_power_tuple', - 'test_rshift_bool', 'test_rshift_bytearray', 'test_rshift_bytes', 'test_rshift_class', 'test_rshift_complex', - 'test_rshift_dict', - 'test_rshift_float', 'test_rshift_frozenset', - 'test_rshift_int', - 'test_rshift_list', - 'test_rshift_none', - 'test_rshift_set', - 'test_rshift_str', - 'test_rshift_tuple', 'test_subtract_bytearray', 'test_subtract_bytes', @@ -365,18 +331,10 @@ class InplaceSetOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_true_divide_complex', 'test_true_divide_frozenset', - 'test_xor_bool', 'test_xor_bytearray', 'test_xor_bytes', 'test_xor_class', 'test_xor_complex', - 'test_xor_dict', - 'test_xor_float', 'test_xor_frozenset', - 'test_xor_int', - 'test_xor_list', - 'test_xor_none', 'test_xor_set', - 'test_xor_str', - 'test_xor_tuple', ] diff --git a/tests/datatypes/test_str.py b/tests/datatypes/test_str.py index eee488b0bb..bcccf3da73 100644 --- a/tests/datatypes/test_str.py +++ b/tests/datatypes/test_str.py @@ -88,9 +88,9 @@ class BinaryStrOperationTests(BinaryOperationTestCase, TranspileTestCase): 'test_modulo_set', 'test_modulo_str', 'test_modulo_tuple', - + 'test_multiply_bytes', - + 'test_ne_bytearray', 'test_ne_bytes', 'test_ne_class', @@ -167,20 +167,11 @@ class InplaceStrOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_add_set', 'test_add_tuple', - 'test_and_bool', 'test_and_bytearray', 'test_and_bytes', 'test_and_class', 'test_and_complex', - 'test_and_dict', - 'test_and_float', 'test_and_frozenset', - 'test_and_int', - 'test_and_list', - 'test_and_none', - 'test_and_set', - 'test_and_str', - 'test_and_tuple', 'test_floor_divide_bytearray', 'test_floor_divide_bytes', @@ -188,20 +179,11 @@ class InplaceStrOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_floor_divide_complex', 'test_floor_divide_frozenset', - 'test_lshift_bool', 'test_lshift_bytearray', 'test_lshift_bytes', 'test_lshift_class', 'test_lshift_complex', - 'test_lshift_dict', - 'test_lshift_float', 'test_lshift_frozenset', - 'test_lshift_int', - 'test_lshift_list', - 'test_lshift_none', - 'test_lshift_set', - 'test_lshift_str', - 'test_lshift_tuple', 'test_modulo_bool', 'test_modulo_bytearray', @@ -225,23 +207,14 @@ class InplaceStrOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_multiply_list', 'test_multiply_none', 'test_multiply_set', - 'test_multiply_str', + 'test_multiply_str', 'test_multiply_tuple', - 'test_or_bool', 'test_or_bytearray', 'test_or_bytes', 'test_or_class', 'test_or_complex', - 'test_or_dict', - 'test_or_float', 'test_or_frozenset', - 'test_or_int', - 'test_or_list', - 'test_or_none', - 'test_or_set', - 'test_or_str', - 'test_or_tuple', 'test_power_bool', 'test_power_bytearray', @@ -258,20 +231,11 @@ class InplaceStrOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_power_str', 'test_power_tuple', - 'test_rshift_bool', 'test_rshift_bytearray', 'test_rshift_bytes', 'test_rshift_class', 'test_rshift_complex', - 'test_rshift_dict', - 'test_rshift_float', 'test_rshift_frozenset', - 'test_rshift_int', - 'test_rshift_list', - 'test_rshift_none', - 'test_rshift_set', - 'test_rshift_str', - 'test_rshift_tuple', 'test_subtract_bytearray', 'test_subtract_bytes', @@ -285,18 +249,9 @@ class InplaceStrOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_true_divide_complex', 'test_true_divide_frozenset', - 'test_xor_bool', 'test_xor_bytearray', 'test_xor_bytes', 'test_xor_class', 'test_xor_complex', - 'test_xor_dict', - 'test_xor_float', 'test_xor_frozenset', - 'test_xor_int', - 'test_xor_list', - 'test_xor_none', - 'test_xor_set', - 'test_xor_str', - 'test_xor_tuple', ] diff --git a/tests/datatypes/test_tuple.py b/tests/datatypes/test_tuple.py index e203e63f71..5d6b99352f 100644 --- a/tests/datatypes/test_tuple.py +++ b/tests/datatypes/test_tuple.py @@ -208,20 +208,11 @@ class InplaceTupleOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_add_set', 'test_add_str', - 'test_and_bool', 'test_and_bytearray', 'test_and_bytes', 'test_and_class', 'test_and_complex', - 'test_and_dict', - 'test_and_float', 'test_and_frozenset', - 'test_and_int', - 'test_and_list', - 'test_and_none', - 'test_and_set', - 'test_and_str', - 'test_and_tuple', 'test_floor_divide_bytearray', 'test_floor_divide_bytes', @@ -229,20 +220,11 @@ class InplaceTupleOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_floor_divide_complex', 'test_floor_divide_frozenset', - 'test_lshift_bool', 'test_lshift_bytearray', 'test_lshift_bytes', 'test_lshift_class', 'test_lshift_complex', - 'test_lshift_dict', - 'test_lshift_float', 'test_lshift_frozenset', - 'test_lshift_int', - 'test_lshift_list', - 'test_lshift_none', - 'test_lshift_set', - 'test_lshift_str', - 'test_lshift_tuple', 'test_modulo_bytearray', 'test_modulo_bytes', @@ -263,20 +245,11 @@ class InplaceTupleOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_multiply_str', 'test_multiply_tuple', - 'test_or_bool', 'test_or_bytearray', 'test_or_bytes', 'test_or_class', 'test_or_complex', - 'test_or_dict', - 'test_or_float', 'test_or_frozenset', - 'test_or_int', - 'test_or_list', - 'test_or_none', - 'test_or_set', - 'test_or_str', - 'test_or_tuple', 'test_power_bool', 'test_power_bytearray', @@ -293,20 +266,11 @@ class InplaceTupleOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_power_str', 'test_power_tuple', - 'test_rshift_bool', 'test_rshift_bytearray', 'test_rshift_bytes', 'test_rshift_class', 'test_rshift_complex', - 'test_rshift_dict', - 'test_rshift_float', 'test_rshift_frozenset', - 'test_rshift_int', - 'test_rshift_list', - 'test_rshift_none', - 'test_rshift_set', - 'test_rshift_str', - 'test_rshift_tuple', 'test_subtract_bytearray', 'test_subtract_bytes', @@ -320,18 +284,9 @@ class InplaceTupleOperationTests(InplaceOperationTestCase, TranspileTestCase): 'test_true_divide_complex', 'test_true_divide_frozenset', - 'test_xor_bool', 'test_xor_bytearray', 'test_xor_bytes', 'test_xor_class', 'test_xor_complex', - 'test_xor_dict', - 'test_xor_float', 'test_xor_frozenset', - 'test_xor_int', - 'test_xor_list', - 'test_xor_none', - 'test_xor_set', - 'test_xor_str', - 'test_xor_tuple', ]