Tim Peters <t...@python.org> added the comment:

I'm not fatally opposed to relaxing k <= n.  David makes some good points about 
it, and - as Raymond already noted - "0" is consistent with the behavior of 
itertools.combinations().

The docs would need to change, though, because the factorial "definition" would 
no longer make sense.  Defining it in terms of the falling factorial would, but 
that's too obscure for Python's audience.  Probably a combinatorial definition 
would be best:  `comb(n, k) is the number of k-element subsets of an n-element 
set".  Then it's clear that n and k are cardinals (integers >= 0), and that the 
result is 0 when k > n.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35431>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to