Skip to content
Snippets Groups Projects
Commit 95c59e8d authored by Jameson Graef Rollins's avatar Jameson Graef Rollins
Browse files

struct: add Struct equality magic method

parent 5db7341c
No related branches found
No related tags found
1 merge request!63Struct improvements
......@@ -215,6 +215,9 @@ class Struct(object):
diffs.append((k, v, ov))
return diffs
def __eq__(self, other):
"""True if structs have all equal values"""
return not bool(self.diff(other))
def to_txt(self, path=None, fmt='0.6e', delimiter=': ', end=''):
"""Return text represenation of Struct, one element per line.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment