Using inspect to see if the first argument is "self" is not reliable.
Either remove this part if lambda should not be used anymore. Or use this: http://stackoverflow.com/questions/3655842/how-to-test-whether-a-variable-holds-a-lambda

Works on python 2 and 3.