]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #1015021: Stop claiming that coerce can return None.
authorMartin v. Löwis <martin@v.loewis.de>
Wed, 25 Aug 2004 10:43:32 +0000 (10:43 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Wed, 25 Aug 2004 10:43:32 +0000 (10:43 +0000)
Doc/lib/libfuncs.tex
Python/bltinmodule.c

index 9fa2323abfce0d517c7af1ad0f37937f07f4d117..d753e9373eeb07a8ba209aa9ee8bf56986e4b2b4 100644 (file)
@@ -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}
index 5edb7e5a4aa5a2c3afbbab324f8f3a37998fcee3..98dae39974192be4a0a85a84af1285fe0989ef06 100644 (file)
@@ -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)