Hi,

Greg Ewing wrote:
> Stefan Behnel wrote:
> 
>> just a quick note that I added support for
>>
>>     from __future__ import ...
> 
> Speaking of that, I realised the other day that Pyrex is
> currently still using the old Python semantics for division,
> and there's no way of getting the new ones.
> 
> What I'd really like to do is make new-style division be
> on all the time, but in light of the recent integer for-loop
> fiasco, I'm reluctant to do anything that might break old
> code.
> 
> So the obvious thing to do is support importing division
> from __future__.

Since Py2-style division is currently broken in the Py3 branch anyway (as Py3
doesn't provide it), a future import makes sense even for Py2, yes.


> My current thought is that this would apply to all division,
> including C types.

So that

    cdef int a = 5, b = 2
    print a / b

would print 2.5 ? I think that would be a surprising result. We should at
least split the future import into "division" and "cdivision" in that case.

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

Reply via email to