-
Notifications
You must be signed in to change notification settings - Fork 161
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
ListPerm
doesn't check its arguments, can give nonsense
#4205
Comments
I agree that these checks should be made. In addition, perhaps we should also change
These kernel functions could reject the case where On the other hand, no serious harm is done by the current behavior? |
These function can be performance critical in some code. Before adding tests one should check thoroughly that the performance loss is negligible for all kinds of valid arguments. |
If you mean OnSets etc: The test would be a simple TNUM test in the kernel in the code for non-permutations. I strongly doubt that would have a measurable overhead. For ListPerm: if performance critical code relies on that, it probably should be rewritten... |
I don't see any harm in the current behaviour of |
I am fine either way, but I do think that |
ListPerm
doesn't check its arguments, can give nonsense
ListPerm
is a global function that doesn't validate its arguments.When given input that is valid (according to its documentation), it behaves fine. Unfortunately people don't always give valid input, such as me 10 minutes ago, when I forgot the brackets in a permutation and wrote
ListPerm(5,20)
.I suggest
ListPerm
should give an error if its first argument isn't a perm and its optional second argument isn't a positive (or non-negative?) integer .The text was updated successfully, but these errors were encountered: