[issue5139] Add combinatoric counting functions to the math module.
Ezio Melotti
report at bugs.python.org
Fri Feb 6 23:44:11 CET 2009
Ezio Melotti <ezio.melotti at gmail.com> added the comment:
> Ezio, itertools currently has combinations with and without
> *replacement*, not repetition.
> I think you're talking about something slightly different
> (repetitions in the *iterable*, rather than allowing
> repeated *drawings* of the same element).
The two terms should be interchangeable (I just used repetitions because
is the one I learnt at school).
> itertools already has 'permutations_with_replacement': it's
> called 'product'.
> combinations(it, r): select r elements from it, no replacement, no order
> permutations(it, r): select r elements, no replacement, order is relevant
> combinations_with_replacement(it, r): replacement, no order
> product(it, repeat=r): replacement, order
Isn't this name (product) not coherent with the others?
Also is not immediately clear to me what a function named 'product' is
supposed to do (but probably it is too late to change it now).
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5139>
_______________________________________
More information about the Python-bugs-list
mailing list