<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1226" rel="nofollow">http://projects.scipy.org/numpy/ticket/1226</a> on 2009-09-18 by trac user jloper, assigned to unknown.</em></p>
<blockquote>
<p dir="auto">array(2**32,int32)<br>
OverflowError</p>
<p dir="auto">array(2*_30,int32)_4<br>
0</p>
</blockquote>
<p dir="auto">oh it would just make me so happy if these two commands COULD have the same output.  just a little flag somewhere.  a little "i love overflow errors" flag.  Just for me.</p>
<p dir="auto">Simple demo:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [1]: np.uint8(0) - np.uint8(1)
RuntimeWarning: overflow encountered in ubyte_scalars
Out[1]: 255

In [2]: np.uint8(0)[...] - np.uint8(1)[...]
Out[2]: 255"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">1</span>]: <span class="pl-s1">np</span>.<span class="pl-en">uint8</span>(<span class="pl-c1">0</span>) <span class="pl-c1">-</span> <span class="pl-s1">np</span>.<span class="pl-en">uint8</span>(<span class="pl-c1">1</span>)
<span class="pl-v">RuntimeWarning</span>: <span class="pl-s1">overflow</span> <span class="pl-s1">encountered</span> <span class="pl-c1">in</span> <span class="pl-s1">ubyte_scalars</span>
<span class="pl-v">Out</span>[<span class="pl-c1">1</span>]: <span class="pl-c1">255</span>

<span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">np</span>.<span class="pl-en">uint8</span>(<span class="pl-c1">0</span>)[...] <span class="pl-c1">-</span> <span class="pl-s1">np</span>.<span class="pl-en">uint8</span>(<span class="pl-c1">1</span>)[...]
<span class="pl-v">Out</span>[<span class="pl-c1">2</span>]: <span class="pl-c1">255</span></pre></div>
<p dir="auto">Should we even warn at all for unsigned integers?</p>