From 2c23c9ec2502884dc22076f5571f572888a57e27 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Wed, 25 Aug 2004 10:43:32 +0000 Subject: [PATCH] Patch #1015021: Stop claiming that coerce can return None. --- Doc/lib/libfuncs.tex | 2 +- Python/bltinmodule.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index 9fa2323abfce..d753e9373eeb 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -1086,7 +1086,7 @@ bypass these functions without concerns about missing something important. \begin{funcdesc}{coerce}{x, y} Return a tuple consisting of the two numeric arguments converted to a common type, using the same rules as used by arithmetic - operations. + operations. If coercion is not possible, raise \exception{TypeError}. \end{funcdesc} \begin{funcdesc}{intern}{string} diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 5edb7e5a4aa5..98dae3997419 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -326,11 +326,11 @@ builtin_coerce(PyObject *self, PyObject *args) } PyDoc_STRVAR(coerce_doc, -"coerce(x, y) -> None or (x1, y1)\n\ +"coerce(x, y) -> (x1, y1)\n\ \n\ -When x and y can be coerced to values of the same type, return a tuple\n\ -containing the coerced values. When they can't be coerced, return None."); - +Return a tuple consisting of the two numeric arguments converted to\n\ +a common type, using the same rules as used by arithmetic operations.\n\ +If coercion is not possible, raise TypeError."); static PyObject * builtin_compile(PyObject *self, PyObject *args) -- 2.47.3