-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
One argument form of math.perm() #81359
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
Comments
The perm() function should have a one argument form and change its signature to itertools.permutations(iterable, r=None)
Return successive r length permutations of elements
in the iterable. If r is not specified or is None, then r defaults to |
perm(n, n) = factorial(n) |
I agree: perm(n) should return factorial(n). |
I never seen a one argument form of P(n, k) in mathematics. itertools.permutations() corresponds two functions: math.perm() and math .factorial(). Unless you a going to add a new function in the itertools module equal to a one argument form of itertools.permutations() there will be no full symmetry. |
It's possible the word permutations means something different to you than it does to me. The itertools.permutations() function is only one function, one that includes the default option to generate all permutations. It does the same as permute(n, r) and permute(n) in Maple; and the same as Permutations[list, n] and Permutations[list] in Mathematica. For the math module, perm(n) is just a common special case that means all possible arrangements. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: