We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
asdf.treeutil.walk_and_modify
Returning asdf.treeutil.RemoveNode from a callback that is processing an item that is part of a list does not result in removal of the node.
asdf.treeutil.RemoveNode
import asdf tree = {"a": [1, 2], "b": 2} def callback(obj): if obj == 2: return asdf.treeutil.RemoveNode return obj new_tree = asdf.treeutil.walk_and_modify(tree, callback) print(new_tree) assert "b" not in new_tree assert "a" in new_tree assert new_tree["a"][0] == 1 assert new_tree["a"][1] == asdf.treeutil.RemoveNode # this should not exist
The above example prints out:
{'a': [1, RemoveNode]}
asdf version: main python version: 3.10 operating system: mac os
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Description of the problem
Returning
asdf.treeutil.RemoveNode
from a callback that is processing an item that is part of a list does not result in removal of the node.Example of the problem
The above example prints out:
System information
asdf version: main
python version: 3.10
operating system: mac os
The text was updated successfully, but these errors were encountered: