June 27, 2019
4:45 a.m.
Chris Angelico writes:
Then I completely don't understand getself. Can you give an example of how it would be used? So far, it just seems like an utter total mess.
It's possible that __getself__ would be implemented "halfway". That is, if __getself__ is present, it is invoked, and performs *side effects* (a simple example would be an access counter/logger for the object). Then the compiler loads that object, discarding any return value of the method. I think this is the semantics that the proponents are thinking of.