On May 14, 2009, at 9:32 PM, Dag Sverre Seljebotn wrote:

> Lisandro wrote:
>> After Robert changes for supporting complex, things are now far  
>> easuer
>> IMHO
>
> A sure hallmark of (Robert's) well-written code is that it makes  
> things
> easier for cases that wasn't considered originally :-)

Thanks. And here I felt like I was sticking is_complex tests in all  
sorts of odd places... (I did try to minimize that.)

>> See the attached patch, testcase included. Disclaimer: this is a
>> completely unpolished hack written in 10 minutes before going home.
>> But now I'm even more confident we will find our way :-)
>
> Wonderful, it looks very good. I'd love to get this in the release if
> possible but I'll have to wait until you trust it (I'll update this  
> if I
> get time for building Sage with it).

Looks good to me too. The line

type_name = self.qualified_name.split('.')[-1]

in __getattr__ seems extraneous, as does the empty comment in the  
PyInt_from... code. With all this testing for basetype.is_int, it is  
almost testing to make a subclass just for int typedefs. Also, we are  
assuming that the only sizes that can occur are char, short, int,  
long, and long long. (It sounds inconceivable, but the C spec would  
allow 16-bit ints and 64-bit longs, or 64-bit ints as in ILP64.)

> There shouldn't be any behavioural changes *if* the external  
> typedef was
> exact, right?

I shouldn't think so.

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to