Repository navigation
Conversation
YongGoose
reviewed
Nov 12, 2026
YongGoose
left a comment
Member
There was a problem hiding this comment.
I checked this against main (36e3ff3) in a Linux container with Python 3.12.
State({"a": 1, "b": 2}).wipe()raisesTypeError: argument of type 'NoneType' is not iterableonmainand returns{}with this change.wipe(keep=[...]),wipe(delete=[...])and empty lists for either behave the same as before.tests/core/test_state.py: 26 passed.
Two things before merging:
- The
typingimport inburr/core/state.pywas rewrapped, which isn't part of the fix. Both black 23.11.0 and isort 5.12.0 with the settings in.pre-commit-config.yamlput it back on one line, so thepre-commitjob will fail once CI runs here. Reverting that hunk is enough. - There is no test for the no-argument case. Something next to
test_state_wipe_delete/test_state_wipe_keepwould cover it:
def test_state_wipe_all():
state = State({"foo": "bar", "baz": "qux"})
wiped = state.wipe()
assert wiped.get_all() == {}
Author
|
Thanks for checking this.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1030.
State.wipe()called with no arguments now clears all keys, as the docs say, instead of raising TypeError onkey not in None.The script in the issue fails before this change and passes after it.