Skip to content

Commit

Permalink
Update __iand__
Browse files Browse the repository at this point in the history
It's not necessary to call setValue. All test_and_* tests now pass.
  • Loading branch information
tbeadle committed Sep 3, 2017
1 parent f91d323 commit 92879e7
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 15 deletions.
3 changes: 1 addition & 2 deletions python/common/org/python/types/Object.java
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,7 @@ public org.python.Object __irshift__(org.python.Object other) {
)
public org.python.Object __iand__(org.python.Object other) {
try {
this.setValue(this.__and__(other));
return this;
return this.__and__(other);
} catch (org.python.exceptions.TypeError e) {
throw new org.python.exceptions.TypeError("unsupported operand type(s) for &=: '" + this.typeName() + "' and '" + other.typeName() + "'");
}
Expand Down
7 changes: 0 additions & 7 deletions python/common/org/python/types/Set.java
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,6 @@ public org.python.Object __or__(org.python.Object other) {
// throw new org.python.exceptions.NotImplementedError("__ror__() has not been implemented");
// }

// @org.python.Method(
// __doc__ = ""
// )
// public void __iand__(org.python.Object other) {
// throw new org.python.exceptions.NotImplementedError("__iand__() has not been implemented");
// }

// @org.python.Method(
// __doc__ = ""
// )
Expand Down
3 changes: 1 addition & 2 deletions python/common/org/python/types/Super.java
Original file line number Diff line number Diff line change
Expand Up @@ -817,8 +817,7 @@ public org.python.Object __irshift__(org.python.Object other) {
)
public org.python.Object __iand__(org.python.Object other) {
try {
this.setValue(this.__and__(other));
return this;
return this.__and__(other);
} catch (org.python.exceptions.TypeError e) {
throw new org.python.exceptions.TypeError("unsupported operand type(s) for &=: 'super()' and '" + other.typeName() + "'");
}
Expand Down
2 changes: 0 additions & 2 deletions tests/datatypes/test_bool.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class InplaceBoolOperationTests(InplaceOperationTestCase, TranspileTestCase):
data_type = 'bool'

not_implemented = [
'test_and_int',

'test_floor_divide_bool',
'test_floor_divide_float',
'test_floor_divide_int',
Expand Down
2 changes: 0 additions & 2 deletions tests/datatypes/test_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ class InplaceComplexOperationTests(InplaceOperationTestCase, TranspileTestCase):
data_type = 'complex'

not_implemented = [
'test_and_none',

'test_eq_None',
'test_eq_NotImplemented',
'test_eq_slice',
Expand Down

0 comments on commit 92879e7

Please sign in to comment.