Yanghao Hua wrote:
this one, on the other hand, is truly generic and universal.
The problem is that it's *too* universal. A __getself__ method would be a sorcerer's-apprentice kind of magic that you can't escape when you don't want it.
Suppose you want to inspect an object for debugging purposes. If it has a __getself__ method that returns something other than itself, it would be impossible to even look at it without it morphing into something else.
Isn't the top level itself a namespace? isn't every function local itself a namespace?
Yes, but namespace-based magic is confined to the namespace you define it on. The proposed object-based magic would be completely inescapable.