This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author glchapman
Recipients
Date 2003-03-01.17:18:52
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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)) { 
History
Date User Action Args
2007-08-23 14:11:35adminlinkissue695651 messages
2007-08-23 14:11:35admincreate