<p dir="auto">Is this expected?</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; x = [None]
&gt;&gt;&gt; x[0] = x
&gt;&gt;&gt; x
[[...]]
&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; np.array(x)
array([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[...]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]], dtype=object)
&gt;&gt;&gt; a = np.array(x)
&gt;&gt;&gt; a.shape
(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
&gt;&gt;&gt; np.__version__
'1.11.1'"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; x = [None]
&gt;&gt;&gt; x[0] = x
&gt;&gt;&gt; x
[[...]]
&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; np.array(x)
array([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[...]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]], dtype=object)
&gt;&gt;&gt; a = np.array(x)
&gt;&gt;&gt; a.shape
(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
&gt;&gt;&gt; np.__version__
'1.11.1'
</code></pre></div>
<p dir="auto">I grant that this one is quite abusive, but bugs that lead to this problem <em>can</em> happen:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ipython3 --pylab
Python 3.5.0 (default, Nov 20 2015, 16:20:41) 
Type &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
?         -&gt; Introduction and overview of IPython's features.
%quickref -&gt; Quick reference.
help      -&gt; Python's own help system.
object?   -&gt; Details about 'object', use 'object??' for extra details.
Using matplotlib backend: TkAgg
Python are go!

In [1]: L = []

In [2]: L.append(L)

In [3]: L.append(L)

In [4]: X = asarray(L)
^C^C^\Quit (core dumped)"><pre class="notranslate"><code class="notranslate">$ ipython3 --pylab
Python 3.5.0 (default, Nov 20 2015, 16:20:41) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
?         -&gt; Introduction and overview of IPython's features.
%quickref -&gt; Quick reference.
help      -&gt; Python's own help system.
object?   -&gt; Details about 'object', use 'object??' for extra details.
Using matplotlib backend: TkAgg
Python are go!

In [1]: L = []

In [2]: L.append(L)

In [3]: L.append(L)

In [4]: X = asarray(L)
^C^C^\Quit (core dumped)
</code></pre></div>
<p dir="auto">Ergo, numpy gets into an infinite loop using 100% CPU and hangs.  Interestingly, the following variant does not lead to the same problem:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ipython3 --pylab
Python 3.5.0 (default, Nov 20 2015, 16:20:41) 
Type &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
?         -&gt; Introduction and overview of IPython's features.
%quickref -&gt; Quick reference.
help      -&gt; Python's own help system.
object?   -&gt; Details about 'object', use 'object??' for extra details.
Using matplotlib backend: TkAgg
Python are go!

In [1]: L = []

In [2]: L.append([L,L])

In [3]: X = asarray(L)

In [4]: print(X.ndim)
32 # huh?

In [6]: print(X)
# lots of ASCII-art"><pre class="notranslate"><code class="notranslate">$ ipython3 --pylab
Python 3.5.0 (default, Nov 20 2015, 16:20:41) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
?         -&gt; Introduction and overview of IPython's features.
%quickref -&gt; Quick reference.
help      -&gt; Python's own help system.
object?   -&gt; Details about 'object', use 'object??' for extra details.
Using matplotlib backend: TkAgg
Python are go!

In [1]: L = []

In [2]: L.append([L,L])

In [3]: X = asarray(L)

In [4]: print(X.ndim)
32 # huh?

In [6]: print(X)
# lots of ASCII-art
</code></pre></div>