[issue12961] itertools: unlabelled balls in boxes

Mark Dickinson report at bugs.python.org
Mon Sep 19 15:14:47 CEST 2011


Mark Dickinson <dickinsm at gmail.com> added the comment:

> Balls-in-boxes _is_ one of the most basic of the canonical combinatorial problems.

Agreed.  But in its basic form, this is covered by itertools.combinations, isn't it?  It may be worth a doc recipe showing how to use itertools.combinations for this (especially since the naive implementation---e.g., the one I posted on comp.lang.python, doesn't get boundary cases right).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12961>
_______________________________________


More information about the Python-bugs-list mailing list