On Thu, 12 Mar 2020 at 19:35, Chris Angelico <ros...@gmail.com> wrote: > I don't understand your point.
Yes, Andrew Barnert already explained me that :) > The broad idea of "del x" returning a value isn't inherently > ridiculous The point is Eric Wieser does not really want this. What he want is something similar to the numpy patch he linked: https://github.com/numpy/numpy/pull/7997 that is an automatic delete of temporary, large objects. For example: z = a + b + c + d will create a temporary (a+b) object and a temporary (a + b) + c object. With that patch, if a, b, c and d are all ndarrays, the temporary objects are discard as soon as they are no more referenced, instead of at the end of the statement. He thought that the change of `del` he proposed will give him that behavior, but this is not true. And I don't think it's very much simple to implement this feature for __all__ Python objects. Maybe for immutable ones, but it should be done one by one, I suppose, since there's not an "immutable iterface". _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/MQVYVM3DEXETWTCHRG7N577E4LOKBNJN/ Code of Conduct: http://python.org/psf/codeofconduct/