-
Notifications
You must be signed in to change notification settings - Fork 44
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
assert_tree_shape_prefix
requires tuple instead of Sequence
#274
Comments
Hi Hylke, thanks for raising the issue! I agree with you that I think the best thing to do would be to convert the |
Thanks for your prompt response. |
Hi,
Thanks for sharing this nice package! I especially like all the assertions for pytrees.
However, I came across the following inconsistency in the documentation:
Current situation
According to the docs, the
shape_prefix
argument ofassert_tree_shape_prefix
is of typeSequence[int]
.However, when I pass sequence such as list (instead of a tuple)
The assertion raises an exception:
The error can simply be fixed by using a tuple instead:
I think this is not the only inconsistent function, but I did not check for others.
Desired situation
Ideally, I would like the function to behave like in the docs, so that I can also pass a list. Why? I think being able to choose square brackets (i.e., list) after closing parenthesis helps readability.
I would be interested to hear your opinion and I am happy to contribute a pull request.
Keep up the good work!
Hylke
The text was updated successfully, but these errors were encountered: