<p dir="auto">Here is a test-case, where I expect the results to always be the same, but they are not.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
dtype=object

print(&quot;[[0]] = array-like&quot;)
A = np.zeros(2, dtype=dtype)
A[[0]] = [[1,2,3,4]]
print(A)

print(&quot;[[0]] = ndarray&quot;)
B = np.zeros(2, dtype=dtype)
B[[0]] = np.array([[1,2,3,4]])
print(B)

print(&quot;[[T,F]] = array-like&quot;)
C = np.zeros(2, dtype=dtype)
C[np.array([True, False])] = [[1,2,3,4]]
print(C)

print(&quot;[[T,F]] = ndarray&quot;)
D = np.zeros(2, dtype=dtype)
D[np.array([True, False])] = np.array([[1,2,3,4]])
print(D)

print(&quot;[0] = array-like&quot;)
E = np.zeros(2, dtype=dtype)
E[0] = [1,2,3,4]
print(E)"><pre class="notranslate"><code class="notranslate">import numpy as np
dtype=object

print("[[0]] = array-like")
A = np.zeros(2, dtype=dtype)
A[[0]] = [[1,2,3,4]]
print(A)

print("[[0]] = ndarray")
B = np.zeros(2, dtype=dtype)
B[[0]] = np.array([[1,2,3,4]])
print(B)

print("[[T,F]] = array-like")
C = np.zeros(2, dtype=dtype)
C[np.array([True, False])] = [[1,2,3,4]]
print(C)

print("[[T,F]] = ndarray")
D = np.zeros(2, dtype=dtype)
D[np.array([True, False])] = np.array([[1,2,3,4]])
print(D)

print("[0] = array-like")
E = np.zeros(2, dtype=dtype)
E[0] = [1,2,3,4]
print(E)
</code></pre></div>
<p dir="auto">To be clear, I expected the result to always be <code class="notranslate">[ [1,2,3,4], 0]</code>.</p>
<p dir="auto">The results in 1.8 are different, but also wrong.</p>
<ul dir="auto">
<li></li>
</ul>
<p dir="auto">A probably related bug: when using <code class="notranslate">dtype=int</code>, then I would expect all the calls to trigger an error message, but they do not.</p>
<p dir="auto">Tested on both 1.9.2 and current master.</p>
<p dir="auto">Usual assignment and now also advanced indexing assignments allow trailing ones in the values array such as:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="np.arange(10)[:] = np.ones((1, 1, 1, 10))"><pre class="notranslate"><code class="notranslate">np.arange(10)[:] = np.ones((1, 1, 1, 10))
</code></pre></div>
<p dir="auto">However boolean indexing does not have any logic in place to ignore these.</p>
<p dir="auto">Also for object assignments view based assignments (and now also advanced indexing assignments through a temporary step) have some extra logic to allow sequences:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [6]: a = np.zeros(3, dtype=object)

In [7]: a[:] = [(1, 2), (2, 3), (3, 4)]

In [8]: a
Out[8]: array([(1, 2), (2, 3), (3, 4)], dtype=object)

In [9]: a[np.array([True, True, True])] = [(1, 2), (2, 3), (3, 4)]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-9-361179bc09da&gt; in &lt;module&gt;()
----&gt; 1 a[np.array([True, True, True])] = [(1, 2), (2, 3), (3, 4)]

TypeError: NumPy boolean array indexing assignment requires a 0 or 1-dimensional input, input has 2 dimensions

In [10]: a[[0, 1, 2]] = [(1, 2), (2, 3), (3, 4)]"><pre class="notranslate"><code class="notranslate">In [6]: a = np.zeros(3, dtype=object)

In [7]: a[:] = [(1, 2), (2, 3), (3, 4)]

In [8]: a
Out[8]: array([(1, 2), (2, 3), (3, 4)], dtype=object)

In [9]: a[np.array([True, True, True])] = [(1, 2), (2, 3), (3, 4)]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-9-361179bc09da&gt; in &lt;module&gt;()
----&gt; 1 a[np.array([True, True, True])] = [(1, 2), (2, 3), (3, 4)]

TypeError: NumPy boolean array indexing assignment requires a 0 or 1-dimensional input, input has 2 dimensions

In [10]: a[[0, 1, 2]] = [(1, 2), (2, 3), (3, 4)]
</code></pre></div>