Author steven.daprano
Recipients FR4NKESTI3N, kellerfuchs, mark.dickinson, rhettinger, serhiy.storchaka, steven.daprano, tim.peters
Date 2019-01-04.02:26:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
> should the function be expanded to calculate for negative 
> n or is the function expected to work only in combination sense?

If this were my design, I would offer both but in separate functions:

def comb(n, k):
    if n < 0: raise ValueError
    return bincoeff(n, k)

def bincoeff(n, k):
    if n < 0:
        return (-1)**k * bincoeff(n+k+1, k)
        # implementation here...

I believe we agreed earlier that supporting non-integers was not 

Are you also providing a perm(n, k) function?
Date User Action Args
2019-01-04 02:26:17steven.dapranosetrecipients: + steven.daprano, tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, kellerfuchs, FR4NKESTI3N
2019-01-04 02:26:15steven.dapranolinkissue35431 messages
2019-01-04 02:26:15steven.dapranocreate