Message80498
It would also be nice to have a __len__ method on both permutations and
combinations.
len(permutations(sequence)) could return the number of permutations
using the formulas (e.g. n! for permutations) without generating all the
possible permutations (as opposed to something like
len(list(permutations(sequence)))).
Also, is there a way to calculate combinations with repetitions[1]?
Maybe we could add an optional argument repetitions=True/False.
[1]:
http://en.wikipedia.org/wiki/Combinations#Number_of_combinations_with_repetition |
|
Date |
User |
Action |
Args |
2009-01-25 07:10:21 | ezio.melotti | set | recipients:
+ ezio.melotti, rhettinger, konryd |
2009-01-25 07:10:21 | ezio.melotti | set | messageid: <1232867421.3.0.38091989471.issue5048@psf.upfronthosting.co.za> |
2009-01-25 07:10:20 | ezio.melotti | link | issue5048 messages |
2009-01-25 07:10:19 | ezio.melotti | create | |
|