You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Atoms are constructed correctly. But when we print out the whole dictionary, we can see that for entry 1,2, and 6 the Atom's internal object has been replaced with the later created Atom with the "mirrored" tuple. And if we check boxes[(0,1)] is boxes[(1,0)] then we get True which is not what we originally expressed.
The same happens with a tuple of strings, or a list of ints, but not with a string (object=str(x)+str(y)).
I guess the minimal test case would be
a=Atom((3,4))
b=Atom((4,3))
print(aisb) # should return False, does return True
a=Atom(('3','4'))
b=Atom(('4','3'))
print(aisb) # should return False, does return True
a=Atom([3,4])
b=Atom([4,3])
print(aisb) # should return False, does return True
The text was updated successfully, but these errors were encountered:
Hm, interesting. It must have to do with the duplicate checking, which probably somehow fails to distinguish differently sorted tuples. I more-or-less understand where it comes from (flattening and then sorting in _get_key()). I will need to think how this could be fixed.
The Atom-constructor incorrectly matches existing objects if they are tuples
The result is
The Atoms are constructed correctly. But when we print out the whole dictionary, we can see that for entry 1,2, and 6 the Atom's internal object has been replaced with the later created Atom with the "mirrored" tuple. And if we check
boxes[(0,1)] is boxes[(1,0)]
then we getTrue
which is not what we originally expressed.The same happens with a tuple of strings, or a list of ints, but not with a string (
object=str(x)+str(y)
).I guess the minimal test case would be
The text was updated successfully, but these errors were encountered: