-
Notifications
You must be signed in to change notification settings - Fork 52
More info when database is missing a node, plus related pruning bugfix #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Interesting, I wasn't sure circle was going to run on a draft |
076e35a
to
e6ff7da
Compare
trie/hexary.py
Outdated
node_type = get_node_type(node) | ||
|
||
# node is mutable, so capture the key for later pruning now | ||
prune_key = self._get_prune_key(node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like potential for forgetting, what about something like:
with self._prune_node(node):
... # do things that might raise errors
The pruning would only happen if the context exits without exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh, how did I miss that. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should be cleaned up.
# Prune only if no exception is raised | ||
try: | ||
yield | ||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need this try/except block at all (and we probably end up taking a performance hit for it).
try:
thing()
except:
raise
else:
something()
# equivalent to
thing()
something()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was wrong?
When a node in the trie was missing, we:
How was it fixed?
TODO
Cute Animal Picture