commit | 1952e388ca63b8eaa090bef966dd538f78ece208 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Wed Sep 19 01:25:16 2001 +0000 |
committer | Guido van Rossum <guido@python.org> | Wed Sep 19 01:25:16 2001 +0000 |
tree | 31afd318ac859dfbe337d2cf6e11fc6c10bcb45f | |
parent | d5d8e4a43632d9d4ec9f6fb23f7405c4f0678617 [diff] [blame] |
Add additional coercion support for "self subtypes" to int, long, float (compare the recent checkin to complex). Added tests for these.
diff --git a/Objects/longobject.c b/Objects/longobject.c index 1e01bf0..8f7d9e4 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c
@@ -2134,6 +2134,11 @@ Py_INCREF(*pv); return 0; } + else if (PyLong_Check(*pw)) { + Py_INCREF(*pv); + Py_INCREF(*pw); + return 0; + } return 1; /* Can't do it */ }