Ezio Melotti <ezio.melo...@gmail.com> added the comment:

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

----------
nosy: +ezio.melotti

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5048>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to