[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

Mark Dickinson report at bugs.python.org
Sat Jan 3 12:53:46 CET 2009


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

I agree that the proposed behaviour seems more correct:  the collection of 
all subsets of size 4 of range(3) is perfectly valid and well-defined;  it 
just happens to be empty.  I've also encountered this in practice (in code 
that was enumerating partitions of a list into a fixed number of pieces), 
but in my case it was easier to work around.

I guess the counterargument is that the current ValueError might catch 
bugs early;  I don't know how often this is true in practice.

In any case, this is Raymond's call.

----------
assignee:  -> rhettinger
nosy: +marketdickinson, rhettinger

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


More information about the Python-bugs-list mailing list