<div dir="ltr"><div>I would like to further push Benjamin Root's suggestion:</div><div><br></div>"Therefore, I think it is not out of the realm of reason that passing a generator object and a dtype could then delegate the work under the hood to np.fromiter()? I would even go so far as to raise an error if one passes a generator without specifying dtype to np.array(). The point is to reduce the number of entry points for creating numpy arrays."<br><div><br></div><div>would this be ok?</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 14, 2015 at 6:50 PM Robert Kern <<a href="mailto:robert.kern@gmail.com">robert.kern@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">On Mon, Dec 14, 2015 at 5:41 PM, Benjamin Root <<a href="mailto:ben.v.root@gmail.com" target="_blank">ben.v.root@gmail.com</a>> wrote:<br>><br>> Heh, never noticed that. Was it implemented more like a generator/iterator in older versions of Python?<br><br></div><div dir="ltr">No, it predates generators and iterators so it has always had to be implemented like that.<br><br>--<br>Robert Kern</div>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org" target="_blank">NumPy-Discussion@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div>