<p dir="auto">Numpy tried to convert an infinite list to numpy.ndarray and I never stopped.<br>
This problem occurs when an array appended with itself more than once.</p>
<h3 dir="auto">Example:</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from numpy import asarray as ar
#from numpy import array as ar
a = []
#Range must be more than 1.
for i in range(2):
    a.append(a)

#This line does not stop.
print(ar(a))"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">numpy</span> <span class="pl-k">import</span> <span class="pl-s1">asarray</span> <span class="pl-k">as</span> <span class="pl-s1">ar</span>
<span class="pl-c">#from numpy import array as ar</span>
<span class="pl-s1">a</span> <span class="pl-c1">=</span> []
<span class="pl-c">#Range must be more than 1.</span>
<span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-c1">2</span>):
    <span class="pl-s1">a</span>.<span class="pl-en">append</span>(<span class="pl-s1">a</span>)

<span class="pl-c">#This line does not stop.</span>
<span class="pl-en">print</span>(<span class="pl-en">ar</span>(<span class="pl-s1">a</span>))</pre></div>
<h3 dir="auto">Numpy/Python version information:</h3>
<p dir="auto">np.<strong>version</strong>: 1.16.5<br>
Python: 3.7.4</p>
<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>