Enhanced ExecutionContext to keep track of the execution flow
This commit is contained in:
+20
-3
@@ -98,9 +98,26 @@ class Concept:
|
||||
|
||||
# check the attributes
|
||||
for prop in PROPERTIES_TO_SERIALIZE:
|
||||
if getattr(self.metadata, prop) != getattr(other.metadata, prop):
|
||||
# print(prop) # use full to know which id does not match
|
||||
return False
|
||||
# print(prop) # use full to know which id does not match
|
||||
my_value = getattr(self.metadata, prop)
|
||||
other_value = getattr(other.metadata, prop)
|
||||
if isinstance(my_value, Concept) and isinstance(other_value, Concept):
|
||||
# need to check if circular references
|
||||
if id(self) == id(other):
|
||||
continue
|
||||
|
||||
sub_value = getattr(other_value.metadata, prop)
|
||||
while isinstance(sub_value, Concept):
|
||||
if id(self) == id(sub_value):
|
||||
return False # circular reference
|
||||
sub_value = getattr(sub_value.metadata, prop)
|
||||
|
||||
if my_value != other_value:
|
||||
return False
|
||||
|
||||
else:
|
||||
if my_value != other_value:
|
||||
return False
|
||||
|
||||
# check the props (Concept variables)
|
||||
for var_name, p in self.props.items():
|
||||
|
||||
Reference in New Issue
Block a user