MAINT: special.perm: adjustments for backward compatibility/consistency #7
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.
Reference issue
scipy#20909
What does this implement/fix?
Before scipy#20909,
perm
accepted lists and arrays as long as(k > N) or (N < 0) or (k < 0)
worked; scipy#20909 immediately began to raise an error for non-scalar input. This changes it to be more flexible about the input unless it doesn't make sense (e.g. lists with more than one element and strings no longer work).Also, scipy#20909 deprecated integral floats. This reverts that change for consistency with the deprecations made to
comb
. For instance, this still works without warning:so this still works without warning
I don't think this is what we want, ultimately, but I figure that
perm
andcomb
should behave similarly so that a decision about what to do about both can be made together.Marked as draft because I'd appreciate your thoughts rather than just merging. This is not necessarily correct; it's just trying to bring up some points that might have been overlooked.