Ezio Melotti <ezio.melo...@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 <rep...@bugs.python.org> <http://bugs.python.org/issue5139> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com