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
"Dunder" methods like __eq__ often have properties that we expect to hold true, universally. CrossHair could help ensure those contracts hold. (by some mechanism TBD) A few random examples:
eval(x.__repr__()) == x (or the repr matches "<.*>")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
"Dunder" methods like
__eq__
often have properties that we expect to hold true, universally. CrossHair could help ensure those contracts hold. (by some mechanism TBD) A few random examples:eval(x.__repr__()) == x
(or the repr matches "<.*>")x.__eq__(y) == y.__eq__(x)
x.__lt__(y) or x.__eq__(y) == x.__lte__(y)
x.__add__(y) == y.__radd__(x)
x.__reversed__().__reversed() == x
bool(x) == bool(x.__len__())
x.__deepcopy__(memo) == memo[id(x)]
Beta Was this translation helpful? Give feedback.
All reactions