Let's be explicit with asserts; there was a bug in histogram
[python_utils.git] / collect / bst.py
index 9d6525946e8131728896d86f3400c38c5ba528e7..8602ce698d9c5d7970f890cfd97d97b8ccb4ffda 100644 (file)
@@ -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