<div dir="ltr">Hi,<div><br></div><div>I think this might be a bug (python 3.3 + cython 0.22.1):</div><div><br></div><div>    <span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;color:rgb(167,29,93)">def</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px"> </span><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;color:rgb(121,93,163)">f</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px">(</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px">term</span><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;color:rgb(167,29,93)">=</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px">b</span><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;color:rgb(223,80,0)"><span>"</span>12345<span>"</span></span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px">):</span></div><pre style="margin-top:0px;margin-bottom:0px;width:748px"><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px">    val <span style="color:rgb(167,29,93)">=</span> <span style="color:rgb(0,134,179)">int</span>(<span style="color:rgb(223,80,0)"><span>'</span>987278186585<span>'</span></span>)
</div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px">    <span style="color:rgb(150,152,150)"># The below line does not work, because it treats 1 as a constant integer</span>
</div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px">    <span style="color:rgb(150,152,150)"># in the C code (32 bit on my machine). Using 1L does work however.</span>
</div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px">    val <span style="color:rgb(167,29,93)">-=</span> <span style="color:rgb(0,134,179)">1</span> <span style="color:rgb(167,29,93)"><<</span> (<span style="color:rgb(0,134,179)">len</span>(term) <span style="color:rgb(167,29,93)">*</span> <span style="color:rgb(0,134,179)">8</span>)
</div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px">    <span style="color:rgb(167,29,93)">return</span> val 
</div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px"> 
</div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px"><span style="color:rgb(167,29,93)">print</span>(f())</div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px"><br></div>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).</pre><pre style="margin-top:0px;margin-bottom:0px;width:748px"><br></pre><pre style="margin-top:0px;margin-bottom:0px;width:748px">Cheers,</pre><pre style="margin-top:0px;margin-bottom:0px;width:748px">Mark </pre></div>