Message14900
On comp.lang.python, David Mertz pointed out this:
>>> class ComplexSub(complex): pass
...
>>> c = ComplexSub(1+1j)
>>> type(c)
<type 'complex'>
In other words, trying to create a ComplexSub returns a
complex. The problem appears to be this check in
complex_new:
/* Special-case for single argumet that is already
complex */
if (PyComplex_CheckExact(r) && i == NULL) {
I believe the above should also check to see if the type
parameter is exactly complex:
/* Special-case for single argumet that is already
complex */
if (PyComplex_CheckExact(r) && i == NULL &&
PyComplex_CheckExact(type)) {
|
|
Date |
User |
Action |
Args |
2007-08-23 14:11:35 | admin | link | issue695651 messages |
2007-08-23 14:11:35 | admin | create | |
|