Mark Dickinson <dicki...@gmail.com> added the comment:

> I suggested to include math.npermutations_with_repetitions for
> completeness,

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).  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

_______________________________________
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

Reply via email to