xxxxxxxxxx
# You have to save the lambda expresion for it to work
nameOfLambda = lambda arg1, arg2: expression
xxxxxxxxxx
def sum ( a, b ): # non anonymous
return a+b
print (sum(1, 2)) # 3
sum = lambda a,b: (a+b) # anonymous / lambda
print (sum(1, 2)) # 3
xxxxxxxxxx
class MicroMock(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def print_foo(x):
print x.foo
print_foo(MicroMock(foo=3))