From 8a38f7e8c3bb3355a20a8a917a834270d3ceef00 Mon Sep 17 00:00:00 2001
From: Chris <Christopher.Happe@uni-duesseldorf.de>
Date: Thu, 18 Feb 2021 12:14:50 +0100
Subject: [PATCH] Update spacing, missing type in constructor + wrong get

---
 .../src/main/python/btypes/BRelation.py       |  2 +-
 .../btypes/BBoolean.py                        | 19 ++++++++++++-------
 .../btypes/BBoolean.py                        |  4 +++-
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/btypes_primitives/src/main/python/btypes/BRelation.py b/btypes_primitives/src/main/python/btypes/BRelation.py
index 948365318..42ec09f31 100644
--- a/btypes_primitives/src/main/python/btypes/BRelation.py
+++ b/btypes_primitives/src/main/python/btypes/BRelation.py
@@ -165,7 +165,7 @@ class BRelation:
 	def relationImage(self, domain: 'BSet') -> 'BSet':
 		result_set = set()
 		for domain_element in domain:
-			this_range_set = self.map[domain_element]
+			this_range_set = self.map.get(domain_element, None)
 			if this_range_set is None:
 				continue
 			result_set = result_set.union(this_range_set)
diff --git a/btypes_primitives/src/main/python_magicstack_immutable/btypes/BBoolean.py b/btypes_primitives/src/main/python_magicstack_immutable/btypes/BBoolean.py
index cb95d7e65..bbb1bfef1 100644
--- a/btypes_primitives/src/main/python_magicstack_immutable/btypes/BBoolean.py
+++ b/btypes_primitives/src/main/python_magicstack_immutable/btypes/BBoolean.py
@@ -4,6 +4,11 @@ class BBoolean:
             self.__value = value
         elif type(value) is str:
             self.__value = str(value).lower() == "true"
+        elif type(value) is BBoolean:
+            self.__value = value.__value
+
+    def __bool__(self) -> 'bool':
+        return self.__value
 
     def __and__(self, other: 'BBoolean') -> 'BBoolean':
         return BBoolean(self.__value and other.__value)
@@ -32,29 +37,29 @@ class BBoolean:
     def __ne__(self, other: 'BBoolean') -> 'BBoolean':
         return BBoolean(self.__value != other.__value)
 
-    def _and(self, other:  'BBoolean') -> 'BBoolean':
+    def _and(self, other: 'BBoolean') -> 'BBoolean':
         return self.__and__(other)
 
-    def _or(self, other:  'BBoolean') -> 'BBoolean':
+    def _or(self, other: 'BBoolean') -> 'BBoolean':
         return self.__or__(other)
 
     def _not(self) -> 'BBoolean':
         return BBoolean(not self.__value)
 
-    def implies(self, other:  'BBoolean') -> 'BBoolean':
+    def implies(self, other: 'BBoolean') -> 'BBoolean':
         return self._not()._or(other)
 
-    def equivalent(self, other:  'BBoolean') -> 'BBoolean':
+    def equivalent(self, other: 'BBoolean') -> 'BBoolean':
         return self.implies(other)._and(other.implies(self))
 
-    def equal(self, other:  'BBoolean') -> 'BBoolean':
+    def equal(self, other: 'BBoolean') -> 'BBoolean':
         return self.__eq__(other)
 
-    def unequal(self, other:  'BBoolean') -> 'BBoolean':
+    def unequal(self, other: 'BBoolean') -> 'BBoolean':
         return self.__ne__(other)
 
     def booleanValue(self) -> 'bool':
         return self.__value
 
     def __hash__(self):
-        return hash(self.__value)
\ No newline at end of file
+        return hash(self.__value)
diff --git a/btypes_primitives/src/main/python_pyrsistant_immutable/btypes/BBoolean.py b/btypes_primitives/src/main/python_pyrsistant_immutable/btypes/BBoolean.py
index cb95d7e65..b30bc48c9 100644
--- a/btypes_primitives/src/main/python_pyrsistant_immutable/btypes/BBoolean.py
+++ b/btypes_primitives/src/main/python_pyrsistant_immutable/btypes/BBoolean.py
@@ -4,6 +4,8 @@ class BBoolean:
             self.__value = value
         elif type(value) is str:
             self.__value = str(value).lower() == "true"
+        elif type(value) is BBoolean:
+            self.__value = value.__value
 
     def __and__(self, other: 'BBoolean') -> 'BBoolean':
         return BBoolean(self.__value and other.__value)
@@ -57,4 +59,4 @@ class BBoolean:
         return self.__value
 
     def __hash__(self):
-        return hash(self.__value)
\ No newline at end of file
+        return hash(self.__value)
-- 
GitLab