Definitely looks interesting. I'd like it more if it was more explicit, but still, it does look nice.
I guess you could make it recursion-safe if you saved/restored the global "__" variable before/after calling the actual function, and probably there's a way to make it thread-safe, too. But how would you make it generator-safe? Also, wouldn't lambda's you pass around from object to object be bound to use the wrong instance? How would you fix this code: class TestA: @memberFunction def do(f): print f() class TestB: @memberFunction def do(x): x.do(lambda : __) TestB().do(TestA()) # should print out TestB, does print out TestA There really should be something like a wiki for "selfishness"-proposals with pros and cons, so I could have looked at some before thinking about my own one... -- http://mail.python.org/mailman/listinfo/python-list