[Cython] Cython 0.23: long + int == int

Jakub Wilk jwilk at jwilk.net
Fri Aug 14 10:41:26 CEST 2015


$ cython --version
Cython version 0.23
$ python2.6 --version
Python 2.6.8
$ cat testlong.pyx
def f(x):
        return 0L + x
$ python2.6 -c 'import pyximport as p; p.install(); import testlong; print type(testlong.f(42))'
<type 'int'>

I added a long to an int, so I'd expect the result to be a long.
This works correctly in Python 2.7:

$ python2.7 -c 'import pyximport as p; p.install(); import testlong; print type(testlong.f(42))'
<type 'long'>

It also worked correctly in Cython 0.22.1 + Python 2.6.

-- 
Jakub Wilk


More information about the cython-devel mailing list