Hi,

I think this might be a bug (python 3.3 + cython 0.22.1):

    def f(term=b"12345"):

    val = int('987278186585')
    # The below line does not work, because it treats 1 as a constant integer
    # in the C code (32 bit on my machine). Using 1L does work however.
    val -= 1 << (len(term) * 8)
    return val

print(f())

This works in pure-python, but Cython generates '1 <<
__pyx_t_somevar', which I think treats the '1' as an integer (causing
it to overflow). Using '1L' works in the Cython code however (but that
may be just my platform).


Cheers,

Mark
_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel

Reply via email to