Add additional coercion support for "self subtypes" to int, long,

float (compare the recent checkin to complex).  Added tests for these.
This commit is contained in:
Guido van Rossum 2001-09-19 01:25:16 +00:00
parent d5d8e4a436
commit 1952e388ca
4 changed files with 50 additions and 1 deletions

View file

@ -590,6 +590,11 @@ float_coerce(PyObject **pv, PyObject **pw)
Py_INCREF(*pv);
return 0;
}
else if (PyFloat_Check(*pw)) {
Py_INCREF(*pv);
Py_INCREF(*pw);
return 0;
}
return 1; /* Can't do it */
}