projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Let's be explicit with asserts; there was a bug in histogram
[python_utils.git]
/
collect
/
bst.py
diff --git
a/collect/bst.py
b/collect/bst.py
index 9d6525946e8131728896d86f3400c38c5ba528e7..8602ce698d9c5d7970f890cfd97d97b8ccb4ffda 100644
(file)
--- a/
collect/bst.py
+++ b/
collect/bst.py
@@
-520,12
+520,12
@@
class BinarySearchTree(object):
return x
path = self.parent_path(node)
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 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
if node != ancestor.right:
return ancestor
node = ancestor