Added __eq__ method to ensure invert_tree_challenge tests pass.

This commit is contained in:
Gregory Mazzola 2017-04-10 21:01:34 -07:00
parent d60f4a904c
commit f16c42aa12

View File

@ -7,7 +7,10 @@ class Node(object):
self.parent = None self.parent = None
def __repr__(self): def __repr__(self):
return str(self.data) return 'Node<data=%s>' % (self.data,)
def __eq__(self, other):
return isinstance(other, Node) and self.data == other.data
class Bst(object): class Bst(object):