Skip to content

Commit

Permalink
Fix mod op and implement in-place xor, or, and rshift opeartors for t…
Browse files Browse the repository at this point in the history
…uples

Signed-off-by: Jenna Hight <[email protected]>
  • Loading branch information
jennahight committed May 30, 2017
1 parent c66d21d commit d3a8d12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 42 deletions.
6 changes: 3 additions & 3 deletions batavia/types/Tuple.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ Tuple.prototype.__floordiv__ = function(other) {
if (types.isinstance(other, types.Complex)) {
throw new exceptions.TypeError.$pyclass("can't take floor of complex number.")
} else {
throw new exceptions.TypeError.$pyclass("unsupported operand type(s) for //=: 'tuple' and '" + type_name(other) + "'")
throw new exceptions.TypeError.$pyclass("unsupported operand type(s) for //: 'tuple' and '" + type_name(other) + "'")
}
}

Expand Down Expand Up @@ -511,15 +511,15 @@ Tuple.prototype.__ilshift__ = function(other) {
}

Tuple.prototype.__irshift__ = function(other) {
throw new exceptions.NotImplementedError.$pyclass('Tuple.__irshift__ has not been implemented')
throw new exceptions.TypeError.$pyclass("unsupported operand type(s) for >>=: 'tuple' and '" + type_name(other) + "'")
}

Tuple.prototype.__iand__ = function(other) {
throw new exceptions.TypeError.$pyclass("unsupported operand type(s) for &=: 'tuple' and '" + type_name(other) + "'")
}

Tuple.prototype.__ixor__ = function(other) {
throw new exceptions.NotImplementedError.$pyclass('Tuple.__ixor__ has not been implemented')
throw new exceptions.TypeError.$pyclass("unsupported operand type(s) for ^=: 'tuple' and '" + type_name(other) + "'")
}

Tuple.prototype.__ior__ = function(other) {
Expand Down
39 changes: 0 additions & 39 deletions tests/datatypes/test_tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,42 +182,3 @@ class BinaryTupleOperationTests(BinaryOperationTestCase, TranspileTestCase):

class InplaceTupleOperationTests(InplaceOperationTestCase, TranspileTestCase):
data_type = 'tuple'

not_implemented = [

'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_NotImplemented',
'test_rshift_range',
'test_rshift_set',
'test_rshift_slice',
'test_rshift_str',
'test_rshift_tuple',

'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_NotImplemented',
'test_xor_range',
'test_xor_set',
'test_xor_slice',
'test_xor_str',
'test_xor_tuple',
]

0 comments on commit d3a8d12

Please sign in to comment.