<h3 dir="auto">Reproducing code example:</h3>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [1]: import numpy as np

In [2]: import sys

In [3]: sys.version
Out[3]: '3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)]'

In [4]: np.__version__
Out[4]: '1.16.4'

In [5]: np.sum(np.arange(10**5))
Out[5]: 704982704

In [6]: sum(np.arange(10**5))
/Anaconda3/Scripts/ipython:1: RuntimeWarning: overflow encountered in long_scalars
Out[6]: 704982704

In [7]: np.sum(np.arange(10**5, dtype=np.int64)) # right result
Out[7]: 4999950000"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">1</span>]: <span class="pl-s1">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>

<span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">import</span> <span class="pl-s1">sys</span>

<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">sys</span>.<span class="pl-s1">version</span>
<span class="pl-v">Out</span>[<span class="pl-c1">3</span>]: <span class="pl-s">'3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)]'</span>

<span class="pl-v">In</span> [<span class="pl-c1">4</span>]: <span class="pl-s1">np</span>.<span class="pl-s1">__version__</span>
<span class="pl-v">Out</span>[<span class="pl-c1">4</span>]: <span class="pl-s">'1.16.4'</span>

<span class="pl-v">In</span> [<span class="pl-c1">5</span>]: <span class="pl-s1">np</span>.<span class="pl-en">sum</span>(<span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">10</span><span class="pl-c1">**</span><span class="pl-c1">5</span>))
<span class="pl-v">Out</span>[<span class="pl-c1">5</span>]: <span class="pl-c1">704982704</span>

<span class="pl-v">In</span> [<span class="pl-c1">6</span>]: <span class="pl-en">sum</span>(<span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">10</span><span class="pl-c1">**</span><span class="pl-c1">5</span>))
<span class="pl-c1">/</span><span class="pl-v">Anaconda3</span><span class="pl-c1">/</span><span class="pl-v">Scripts</span><span class="pl-c1">/</span><span class="pl-s1">ipython</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">long_scalars</span>
<span class="pl-v">Out</span>[<span class="pl-c1">6</span>]: <span class="pl-c1">704982704</span>

<span class="pl-v">In</span> [<span class="pl-c1">7</span>]: <span class="pl-s1">np</span>.<span class="pl-en">sum</span>(<span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">10</span><span class="pl-c1">**</span><span class="pl-c1">5</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-s1">int64</span>)) <span class="pl-c"># right result</span>
<span class="pl-v">Out</span>[<span class="pl-c1">7</span>]: <span class="pl-c1">4999950000</span></pre></div>
<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>