On Fri, Jun 28, 2019 at 3:55 AM Steven D'Aprano
On Fri, Jun 28, 2019 at 02:44:28AM +1000, Chris Angelico wrote:
If it's ALWAYS called, then it's almost useless. The wrapper object will vanish the moment you attempt to do anything with it, devolving instantly to the result of getself.
I don't understand why it is useless. If the wrapper object is no longer needed, then getself will return the object which is needed, and the wrapper is superfluous and should be garbage collected.
If the wrapper object is needed, then getself will return self, and it won't disappear.
Are we talking past each other?
Without any magic, merely attempting to return the wrapper would cause it to collapse to the underlying object (by calling getself). Therefore, the proposal - to be at all useful - has to have some form of magic to decide whether touching the object gives you the wrapper or calls getself. It's fundamental to the proposal that it be magical. ChrisA