<p dir="auto">This is needed for compatibility with <code class="notranslate">histogram</code>, which deprecated <code class="notranslate">normed</code> in favor of <code class="notranslate">density</code>.</p>
<h3 dir="auto">Reproducing code example:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python3 -c 'print(1.0&lt;1.0+1.0j)'
Traceback (most recent call last):
  File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
TypeError: '&lt;' not supported between instances of 'float' and 'complex'
$ python3 -c 'import numpy; print(1.0&lt;numpy.complex64(1.0+1.0j))'
True
$ python3 -c 'import numpy; print(1.0&lt;numpy.complex64(1.0-1.0j))'
False"><pre class="notranslate"><code class="notranslate">$ python3 -c 'print(1.0&lt;1.0+1.0j)'
Traceback (most recent call last):
  File "&lt;string&gt;", line 1, in &lt;module&gt;
TypeError: '&lt;' not supported between instances of 'float' and 'complex'
$ python3 -c 'import numpy; print(1.0&lt;numpy.complex64(1.0+1.0j))'
True
$ python3 -c 'import numpy; print(1.0&lt;numpy.complex64(1.0-1.0j))'
False
</code></pre></div>
<h3 dir="auto">NumPy/Python version information:</h3>
<p dir="auto">1.17.4 3.8.5 (default, May 27 2021, 13:30:53)<br>
[GCC 9.3.0]</p>
<p dir="auto">The bare python implementation throws an error, as it should. The behavior of the numpy.complex64 class shows behavior that is inconsistent with that, doesn't make sense mathematically, and doesn't seem to be documented anywhere. It appears to be doing a lexicographic comparison of real and imaginary parts. It should throw a type error instead. Since the present behavior does not seem to be defined anywhere, nobody should be depending on the undefined behavior, and fixing it should not cause problems.</p>