On Mi, 2014-12-10 at 07:25 +0000, Sturla Molden wrote: > Nathaniel Smith <n...@pobox.com> wrote: > > > This should be pretty trivial to implement. AFAICT you don't need any > > complicated cython > > I have a bad habit of thinking in terms of too complicated C instead of > just using NumPy. > > > > @contextmanager > > def tmp_zeros(*args, **kwargs): > > arr = np.zeros(*args, **kwargs) > > try: > > yield arr > > finally: > > arr.resize((0,), check_refs=False) > > > > Given how intrinsically dangerous this is, and how easily it can be > > implemented using numpy's existing public API, I think maybe we should > > leave this for third-party daredevils instead of implementing it in numpy > > proper. > > It seems so :-)
Completly agree, we may tell the user where the gun is, but we shouldn't put it in their hand and then point it at their feet as well ;). - Sebastian > > > Sturla > > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion >
signature.asc
Description: This is a digitally signed message part
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion