<p dir="auto">Raised by <a href="http://stackoverflow.com/q/42943875/102441" rel="nofollow">this</a> stackoverflow question. The following code , run on master...</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="x_actual = 49997
x3_actual = x_actual ** 3

for dtype in [np.int64, np.uint64, np.float64]:
	x = {}
	x['scalar'] = dtype(x_actual)
	x[    '0d'] = np.array(x_actual, dtype=dtype)
	x[    '1d'] = np.array([x_actual], dtype=dtype)
	x[    '2d'] = np.array([[x_actual]], dtype=dtype)

	x3 = {k: x**3 for k, x in x.items()}

	assert all(v == x3_actual for v in x3.values())  #ok

	print(&quot;input type of {}:&quot;.format(np.dtype(dtype)))
	for k, v in x3.items():
		print(&quot;{:&gt;8s}: {}&quot;.format(k, v.dtype))
	print()"><pre class="notranslate"><span class="pl-s1">x_actual</span> <span class="pl-c1">=</span> <span class="pl-c1">49997</span>
<span class="pl-s1">x3_actual</span> <span class="pl-c1">=</span> <span class="pl-s1">x_actual</span> <span class="pl-c1">**</span> <span class="pl-c1">3</span>

<span class="pl-k">for</span> <span class="pl-s1">dtype</span> <span class="pl-c1">in</span> [<span class="pl-s1">np</span>.<span class="pl-s1">int64</span>, <span class="pl-s1">np</span>.<span class="pl-s1">uint64</span>, <span class="pl-s1">np</span>.<span class="pl-s1">float64</span>]:
	<span class="pl-s1">x</span> <span class="pl-c1">=</span> {}
	<span class="pl-s1">x</span>[<span class="pl-s">'scalar'</span>] <span class="pl-c1">=</span> <span class="pl-en">dtype</span>(<span class="pl-s1">x_actual</span>)
	<span class="pl-s1">x</span>[    <span class="pl-s">'0d'</span>] <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>(<span class="pl-s1">x_actual</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">dtype</span>)
	<span class="pl-s1">x</span>[    <span class="pl-s">'1d'</span>] <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-s1">x_actual</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">dtype</span>)
	<span class="pl-s1">x</span>[    <span class="pl-s">'2d'</span>] <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([[<span class="pl-s1">x_actual</span>]], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">dtype</span>)

	<span class="pl-s1">x3</span> <span class="pl-c1">=</span> {<span class="pl-s1">k</span>: <span class="pl-s1">x</span><span class="pl-c1">**</span><span class="pl-c1">3</span> <span class="pl-k">for</span> <span class="pl-s1">k</span>, <span class="pl-s1">x</span> <span class="pl-c1">in</span> <span class="pl-s1">x</span>.<span class="pl-en">items</span>()}

	<span class="pl-k">assert</span> <span class="pl-en">all</span>(<span class="pl-s1">v</span> <span class="pl-c1">==</span> <span class="pl-s1">x3_actual</span> <span class="pl-k">for</span> <span class="pl-s1">v</span> <span class="pl-c1">in</span> <span class="pl-s1">x3</span>.<span class="pl-en">values</span>())  <span class="pl-c">#ok</span>

	<span class="pl-en">print</span>(<span class="pl-s">"input type of {}:"</span>.<span class="pl-en">format</span>(<span class="pl-s1">np</span>.<span class="pl-en">dtype</span>(<span class="pl-s1">dtype</span>)))
	<span class="pl-k">for</span> <span class="pl-s1">k</span>, <span class="pl-s1">v</span> <span class="pl-c1">in</span> <span class="pl-s1">x3</span>.<span class="pl-en">items</span>():
		<span class="pl-en">print</span>(<span class="pl-s">"{:&gt;8s}: {}"</span>.<span class="pl-en">format</span>(<span class="pl-s1">k</span>, <span class="pl-s1">v</span>.<span class="pl-s1">dtype</span>))
	<span class="pl-en">print</span>()</pre></div>
<p dir="auto">Gives the alarming output of:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="input of int64
  scalar: int64
      0d: int64
      1d: int64
      2d: int64

input of uint64
  scalar: float64
      0d: float64
      1d: uint64    # What?
      2d: uint64    # What?

input of float64
  scalar: float64
      0d: float64
      1d: float64
      2d: float64"><pre class="notranslate"><code class="notranslate">input of int64
  scalar: int64
      0d: int64
      1d: int64
      2d: int64

input of uint64
  scalar: float64
      0d: float64
      1d: uint64    # What?
      2d: uint64    # What?

input of float64
  scalar: float64
      0d: float64
      1d: float64
      2d: float64
</code></pre></div>
<p dir="auto">The return <code class="notranslate">dtype</code> of power should not depend on the shape of the input array</p>
<p dir="auto">This is to gather and close some other issues.  The NEP 50 proposal would close it.  In many cases using int64 as the default Python integer for scalar operations (where we disable value-based logic) can be surprising</p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="10533985" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/2955" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/2955/hovercard" href="https://github.com/numpy/numpy/issues/2955">gh-2955</a> (bitwise_and)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="66254462" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/5746" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/5746/hovercard" href="https://github.com/numpy/numpy/issues/5746">gh-5746</a> (comparison) although uint64 and int64 comparisons of course have still more issues (covered by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="389178680" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/12525" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/12525/hovercard" href="https://github.com/numpy/numpy/issues/12525">gh-12525</a>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="7731593" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/2524" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/2524/hovercard" href="https://github.com/numpy/numpy/issues/2524">gh-2524</a> (bit shift operators)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="216032133" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/8809" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/8809/hovercard" href="https://github.com/numpy/numpy/issues/8809">gh-8809</a> power is surprising for promotion (which is just the normal madness of scalar+value-based logic), again together with <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="389178680" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/12525" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/12525/hovercard" href="https://github.com/numpy/numpy/issues/12525">gh-12525</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="415655775" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/13057" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/13057/hovercard" href="https://github.com/numpy/numpy/issues/13057">gh-13057</a> (division of uint by Python int)</li>
</ul>
<p dir="auto">This issue is just to gather and close the other ones as duplicates.</p>