Stefan Behnel wrote: > Dag Sverre Seljebotn, 03.12.2009 10:48: > >> This is particularily useful for loops, as looping variables can all be >> set to ssize_t without further ado. >> > > This sounds a little too generic, so although I assume you're aware of it, > let me clarify that even loop variables would have to depend on such a > directive as this must work in the general case: > > for i in xrange(2**123456, 2**123456 + 2): print i > Yep, that would violate setting the bigintegetr directive. The directive would basically say "operate as if the Python integer type was a ssize_t", even for range and friends.
I guess the bigger point of my post was various user-friendly ways of making type inference which *didn't* break backwards compatabiliy. I think a typical user either a) Type all variables b) or assume no overflows occur (i.e. don't exploit overflow behaviour) Trying to track which types variables would be assigned by a typeinference directive seems a very confusing way to work, hence I propose biginteger instead which keeps backwards compatability. Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
