[Python-Dev] Possible bug in complexobject.c (still in Python 2.5)

2006-05-31 Thread Travis E. Oliphant
I'm curious about the difference between float_subtype_new in floatobject.c complex_subtype_from_c_complex in complexobject.c The former uses type-tp_alloc(type, 0) to create memory for the object while the latter uses PyType_GenericAlloc(type, 0) to create memory for the sub-type (thereby

[Python-Dev] Possible bug in complexobject.c (still in Python 2.5)

2006-05-31 Thread Travis E. Oliphant
I'm curious about the difference between float_subtype_new in floatobject.c complex_subtype_from_c_complex in complexobject.c The former uses type-tp_alloc(type, 0) to create memory for the object while the latter uses PyType_GenericAlloc(type, 0) to create memory for the sub-type (thereby

Re: [Python-Dev] Possible bug in complexobject.c (still in Python 2.5)

2006-05-31 Thread Guido van Rossum
I wouldn't be surprised if this is a genuine bug; the complex type doesn't get a lot of love from core developers. Could you come up with a proposed fix, and a unit test showing that it works (and that the old version doesn't)? (Maybe a good unit test would require writing a custome C extension;

Re: [Python-Dev] Possible bug in complexobject.c (still in Python 2.5)

2006-05-31 Thread skip
Guido (Maybe a good unit test would require writing a custome C Guido extension; in that case just show some sample code.) Isn't that what Module/_testcapimodule.c is for? Skip ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Possible bug in complexobject.c (still in Python 2.5)

2006-05-31 Thread Travis E. Oliphant
Guido van Rossum wrote: I wouldn't be surprised if this is a genuine bug; the complex type doesn't get a lot of love from core developers. Could you come up with a proposed fix, and a unit test showing that it works (and that the old version doesn't)? (Maybe a good unit test would require

Re: [Python-Dev] Possible bug in complexobject.c (still in Python 2.5)

2006-05-31 Thread Travis E. Oliphant
Travis E. Oliphant wrote: I'm curious about the difference between float_subtype_new in floatobject.c complex_subtype_from_c_complex in complexobject.c The former uses type-tp_alloc(type, 0) to create memory for the object while the latter uses PyType_GenericAlloc(type, 0) to create