<p dir="auto">It seems that numpy does not recognize the following overflow error:</p>
<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]: data = np.array((65536, 65535), dtype=np.int32)

In [3]: np.geterr()
Out[3]: {'divide': 'warn', 'invalid': 'warn', 'over': 'warn', 'under': 'ignore'}

In [4]: np.cumprod(data)
Out[4]: array([ 65536, -65536], dtype=int32)

In [5]: with np.errstate(over=&quot;raise&quot;):
   ...:     np.cumprod(data)
   ...:"><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">data</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>((<span class="pl-c1">65536</span>, <span class="pl-c1">65535</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-s1">int32</span>)

<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">np</span>.<span class="pl-en">geterr</span>()
<span class="pl-v">Out</span>[<span class="pl-c1">3</span>]: {<span class="pl-s">'divide'</span>: <span class="pl-s">'warn'</span>, <span class="pl-s">'invalid'</span>: <span class="pl-s">'warn'</span>, <span class="pl-s">'over'</span>: <span class="pl-s">'warn'</span>, <span class="pl-s">'under'</span>: <span class="pl-s">'ignore'</span>}

<span class="pl-v">In</span> [<span class="pl-c1">4</span>]: <span class="pl-s1">np</span>.<span class="pl-en">cumprod</span>(<span class="pl-s1">data</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">4</span>]: <span class="pl-en">array</span>([ <span class="pl-c1">65536</span>, <span class="pl-c1">-</span><span class="pl-c1">65536</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">int32</span>)

<span class="pl-v">In</span> [<span class="pl-c1">5</span>]: <span class="pl-s1">with</span> <span class="pl-s1">np</span>.<span class="pl-en">errstate</span>(<span class="pl-s1">over</span><span class="pl-c1">=</span><span class="pl-s">"raise"</span>):
   ...:     <span class="pl-s1">np</span>.<span class="pl-en">cumprod</span>(<span class="pl-s1">data</span>)
   ...:</pre></div>
<p dir="auto">No warnings or exceptions are raised</p>
<p dir="auto">I just noticed that this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: import numpy as np

In [2]: arr = np.zeros((2, 3), dtype=np.int16) + np.int16(3201)

In [3]: arr.T.dot(arr)
Out[3]: 
array([[-19966, -19966, -19966],
       [-19966, -19966, -19966],
       [-19966, -19966, -19966]], dtype=int16)"><pre class="notranslate"><code class="notranslate">In [1]: import numpy as np

In [2]: arr = np.zeros((2, 3), dtype=np.int16) + np.int16(3201)

In [3]: arr.T.dot(arr)
Out[3]: 
array([[-19966, -19966, -19966],
       [-19966, -19966, -19966],
       [-19966, -19966, -19966]], dtype=int16)
</code></pre></div>
<p dir="auto">spits out no warning about integer overflow.  Is it possible to generate one?</p>