]> granicus.if.org Git - python/commitdiff
Patch #1015021: Stop claiming that coerce can return None.
authorMartin v. Löwis <martin@v.loewis.de>
Wed, 25 Aug 2004 10:42:41 +0000 (10:42 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Wed, 25 Aug 2004 10:42:41 +0000 (10:42 +0000)
Will backport to 2.3.

Doc/lib/libfuncs.tex
Python/bltinmodule.c

index 1130eb1688a39f54b06cc2639556b6e74e21bcd7..d21051022c8f3046fa3ec964393598dc02da6189 100644 (file)
@@ -1180,7 +1180,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}
index f7715b6de7ed739edf723d9b53b8ac3caa643cb3..6fbe799f71139e9b4b27040e5488edec1f949ed0 100644 (file)
@@ -322,11 +322,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)