Robert Bradshaw wrote:

> I think in general that is a good idea, but the problem is that 
> PyLong_FromUnsignedLong is slower than PyInt_FromLong and produces python 
> longs rather than python ints. One would need a special type (or flag) to 
> indicate that the top bit can be assumed to be 0.

There could be a utility function that creates either an
int or a long depending on the value passed to it.

It might also be possible to choose between them at
compile time in the case of literals, although it would
be tricky because it would depend on sizeof(int) on
the target platform. Some kind of macro might be
able to do it.

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

Reply via email to