Below python code,
>>> def f(): return
function type object which has
__name__ attribute with value
'f' which looks fine.
Below line of code,
>>> x = 1024
int type object but does not have
lambda expressions in python also does not associate any unique name for a
function type object.
>>> square = lambda x: x * x >>> square.__name__ '<lambda>' >>> summation = lambda x: x + 2 >>> summation.__name__ '<lambda>' >>>
For any program written using Functional paradigm, it is considered an environment with name-object bindings in that environment.
So, Being functional paradigm programming beginner, How do I understand the significance of
__name__ attribute? Why do I see such inconsistency in second and third case above in not maintaining
__name__ attribute of an object?