On 13/03/20 12:30 pm, Marco Sulla via Python-ideas wrote:
As you can see, Thing(abcd) has the same id of Thing(ab). So what Eric
Wieser wanted is already implemented in Python, for temporary objects.

This is probably an accident. It's not really re-using an object,
it's just that the object created for a+b+c+d happens to land in the
same block of memory that was freed when a+b became unreferenced.
It's not actually saving the cost of a memory allocation the way
the numpy optimisation does.

--
Greg
_______________________________________________
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/IAUCA7QTBV3XC5A3LGQ24CHKJAVZGYI4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to