diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2019-06-04 08:23:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-04 08:23:06 (GMT) |
commit | 963eb0f4738456455b9bef7eb531b46805415208 (patch) | |
tree | bd083ca435e4fe0f67410d06db5cf98674865a73 /Modules/clinic | |
parent | 0fd2c300c2a85b3b227a907b2a39ef79fa86d850 (diff) | |
download | cpython-963eb0f4738456455b9bef7eb531b46805415208.zip cpython-963eb0f4738456455b9bef7eb531b46805415208.tar.gz cpython-963eb0f4738456455b9bef7eb531b46805415208.tar.bz2 |
bpo-35431: Drop the k <= n requirement (GH-13798)
Diffstat (limited to 'Modules/clinic')
-rw-r--r-- | Modules/clinic/mathmodule.c.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h index 0efe5cc..cdf4305 100644 --- a/Modules/clinic/mathmodule.c.h +++ b/Modules/clinic/mathmodule.c.h @@ -644,10 +644,11 @@ PyDoc_STRVAR(math_perm__doc__, "\n" "Number of ways to choose k items from n items without repetition and with order.\n" "\n" -"It is mathematically equal to the expression n! / (n - k)!.\n" +"Evaluates to n! / (n - k)! when k <= n and evaluates\n" +"to zero when k > n.\n" "\n" -"Raises TypeError if the arguments are not integers.\n" -"Raises ValueError if the arguments are negative or if k > n."); +"Raises TypeError if either of the arguments are not integers.\n" +"Raises ValueError if either of the arguments are negative."); #define MATH_PERM_METHODDEF \ {"perm", (PyCFunction)(void(*)(void))math_perm, METH_FASTCALL, math_perm__doc__}, @@ -679,12 +680,15 @@ PyDoc_STRVAR(math_comb__doc__, "\n" "Number of ways to choose k items from n items without repetition and without order.\n" "\n" -"Also called the binomial coefficient. It is mathematically equal to the expression\n" -"n! / (k! * (n - k)!). It is equivalent to the coefficient of k-th term in\n" -"polynomial expansion of the expression (1 + x)**n.\n" +"Evaluates to n! / (k! * (n - k)!) when k <= n and evaluates\n" +"to zero when k > n.\n" "\n" -"Raises TypeError if the arguments are not integers.\n" -"Raises ValueError if the arguments are negative or if k > n."); +"Also called the binomial coefficient because it is equivalent\n" +"to the coefficient of k-th term in polynomial expansion of the\n" +"expression (1 + x)**n.\n" +"\n" +"Raises TypeError if either of the arguments are not integers.\n" +"Raises ValueError if either of the arguments are negative."); #define MATH_COMB_METHODDEF \ {"comb", (PyCFunction)(void(*)(void))math_comb, METH_FASTCALL, math_comb__doc__}, @@ -709,4 +713,4 @@ math_comb(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=a82b0e705b6d0ec0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5004266613284dcc input=a9049054013a1b77]*/ |