Lisandro Dalcin wrote: > + Look at the module-level tuple variable 'rank_to_type_name'. You can > see that 'Py_ssize_t' and 'size_t' are AFTER the type 'PY_LONG_LONG'. > > + Now look at the implementation of the function 'widest_numeric_type()'.
The basic problem here is that the Cython type system has been stretched a bit too far beyond what was originally cocceived in Pyrex. In the beginning, Pyrex only knew about built-in C types, and although it didn't know their actual sizes, it did know their relative sizes, so it could calculate a widest type. But now that we have things like Py_ssize_t that can be defined differently on different platforms, that's no longer possible. I think the only completely correct thing to do would be to introduce the notion of ints of unknow size and/or signedness, and to refuse to implicitly convert anything of such a type. The programmer would have to be explicit about the conversion wanted in that case, e.g. by casting it to a standard C type. -- Greg _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
