diff Objects/floatobject.c @ 19976:da00188d5270 legacy-trunk

Add additional coercion support for "self subtypes" to int, long, float (compare the recent checkin to complex). Added tests for these.
author Guido van Rossum <guido@python.org>
date Wed, 19 Sep 2001 01:25:16 +0000
parents 733314fcfdaa
children 2983b54256c7
line wrap: on
line diff
--- a/Objects/floatobject.c	Wed Sep 19 01:16:16 2001 +0000
+++ b/Objects/floatobject.c	Wed Sep 19 01:25:16 2001 +0000
@@ -590,6 +590,11 @@
 		Py_INCREF(*pv);
 		return 0;
 	}
+	else if (PyFloat_Check(*pw)) {
+		Py_INCREF(*pv);
+		Py_INCREF(*pw);
+		return 0;
+	}
 	return 1; /* Can't do it */
 }