diff --git a/python/common/org/python/types/DictItems.java b/python/common/org/python/types/DictItems.java index 11c2f387ac..c2056f99fd 100644 --- a/python/common/org/python/types/DictItems.java +++ b/python/common/org/python/types/DictItems.java @@ -111,7 +111,7 @@ public org.python.Object __invert__() { __doc__ = "" ) public org.python.Object __bool__() { - return new org.python.types.Bool(!this.value.isEmpty()); + return org.python.types.Bool.getBool(!this.value.isEmpty()); } @org.python.Method( @@ -198,7 +198,7 @@ public org.python.Object __not_contains__(org.python.Object other) { public org.python.Object __lt__(org.python.Object other) { if (other instanceof org.python.types.DictItems) { org.python.types.DictItems otherItems = (org.python.types.DictItems) other; - return new org.python.types.Bool(otherItems.value.containsAll(this.value) && !this.value.equals(otherItems.value)); + return org.python.types.Bool.getBool(otherItems.value.containsAll(this.value) && !this.value.equals(otherItems.value)); } return org.python.types.NotImplementedType.NOT_IMPLEMENTED; } @@ -210,7 +210,7 @@ public org.python.Object __lt__(org.python.Object other) { public org.python.Object __le__(org.python.Object other) { if (other instanceof org.python.types.DictItems) { org.python.types.DictItems otherItems = (org.python.types.DictItems) other; - return new org.python.types.Bool(otherItems.value.containsAll(this.value)); + return org.python.types.Bool.getBool(otherItems.value.containsAll(this.value)); } return org.python.types.NotImplementedType.NOT_IMPLEMENTED; } @@ -222,7 +222,7 @@ public org.python.Object __le__(org.python.Object other) { public org.python.Object __eq__(org.python.Object other) { if (other instanceof org.python.types.DictItems) { org.python.types.DictItems otherItems = (org.python.types.DictItems) other; - return new org.python.types.Bool(this.value.equals(otherItems.value)); + return org.python.types.Bool.getBool(this.value.equals(otherItems.value)); } return org.python.types.NotImplementedType.NOT_IMPLEMENTED; } @@ -234,7 +234,7 @@ public org.python.Object __eq__(org.python.Object other) { public org.python.Object __gt__(org.python.Object other) { if (other instanceof org.python.types.DictItems) { org.python.types.DictItems otherItems = (org.python.types.DictItems) other; - return new org.python.types.Bool(this.value.containsAll(otherItems.value) && !this.value.equals(otherItems.value)); + return org.python.types.Bool.getBool(this.value.containsAll(otherItems.value) && !this.value.equals(otherItems.value)); } return org.python.types.NotImplementedType.NOT_IMPLEMENTED; } @@ -246,7 +246,7 @@ public org.python.Object __gt__(org.python.Object other) { public org.python.Object __ge__(org.python.Object other) { if (other instanceof org.python.types.DictItems) { org.python.types.DictItems otherItems = (org.python.types.DictItems) other; - return new org.python.types.Bool(this.value.containsAll(otherItems.value)); + return org.python.types.Bool.getBool(this.value.containsAll(otherItems.value)); } return org.python.types.NotImplementedType.NOT_IMPLEMENTED; } @@ -331,6 +331,6 @@ public org.python.types.Set __rsub__(org.python.Object other) { public org.python.Object isdisjoint(org.python.Object other) { java.util.Set generated = this.fromIter(other); generated.retainAll(this.value); - return new org.python.types.Bool(generated.size() > 0); + return org.python.types.Bool.getBool(generated.size() > 0); } -} \ No newline at end of file +} diff --git a/python/common/org/python/types/DictKeys.java b/python/common/org/python/types/DictKeys.java index 98e9bae48a..48ef922140 100644 --- a/python/common/org/python/types/DictKeys.java +++ b/python/common/org/python/types/DictKeys.java @@ -221,7 +221,7 @@ public org.python.Object isdisjoint(org.python.Object other) { } catch (org.python.exceptions.StopIteration si) { } generated.retainAll(this.value); - return new org.python.types.Bool(generated.size() > 0); + return org.python.types.Bool.getBool(generated.size() > 0); } /** * The following methods are not present in Python's dict_keys but are present in DictKeys (inherited from FrozenSet) diff --git a/python/common/org/python/types/DictValues.java b/python/common/org/python/types/DictValues.java index 85e69ab531..f7797a700f 100644 --- a/python/common/org/python/types/DictValues.java +++ b/python/common/org/python/types/DictValues.java @@ -101,7 +101,7 @@ public org.python.Object __invert__() { __doc__ = "" ) public org.python.Object __bool__() { - return new org.python.types.Bool(!this.value.isEmpty()); + return org.python.types.Bool.getBool(!this.value.isEmpty()); } @org.python.Method( @@ -168,7 +168,7 @@ public void __delitem__(org.python.Object item) { args = {"item"} ) public org.python.Object __contains__(org.python.Object item) { - return new org.python.types.Bool(this.value.contains(item)); + return org.python.types.Bool.getBool(this.value.contains(item)); } @org.python.Method( @@ -176,6 +176,6 @@ public org.python.Object __contains__(org.python.Object item) { args = {"item"} ) public org.python.Object __not_contains__(org.python.Object item) { - return new org.python.types.Bool(!this.value.contains(item)); + return org.python.types.Bool.getBool(!this.value.contains(item)); } }