From 7ff2af6fe7bffea90dc4a31c93140c189917c659 Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 2 Feb 2022 13:47:36 -0800 Subject: Let's be explicit with asserts; there was a bug in histogram caused by assert foo when foo was an int with valid valid 0. --- collect/bst.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'collect/bst.py') diff --git a/collect/bst.py b/collect/bst.py index 9d65259..8602ce6 100644 --- a/collect/bst.py +++ b/collect/bst.py @@ -520,12 +520,12 @@ class BinarySearchTree(object): return x path = self.parent_path(node) - assert path[-1] + assert path[-1] is not None assert path[-1] == node path = path[:-1] path.reverse() for ancestor in path: - assert ancestor + assert ancestor is not None if node != ancestor.right: return ancestor node = ancestor -- cgit v1.3