Oh, really? Let's compare:
>>> absolute_0 = lambda path: path if path.startswith('/') else '/' + path
>>> def absolute_1(path):
... '''Return the absolute unix path from a given path name'''
... if not path.startswith('/'):
... path = '/' + path
... return path
>>> import dis
>>> dis.dis(absolute_0)
2 0 LOAD_FAST 0 (path)
3 LOAD_ATTR 0 (startswith)
6 LOAD_CONST 1 ('/')
9 CALL_FUNCTION 1
12 POP_JUMP_IF_FALSE 19
15 LOAD_FAST 0 (path)
18 RETURN_VALUE
>> 19 LOAD_CONST 1 ('/')
22 LOAD_FAST 0 (path)
25 BINARY_ADD
26 RETURN_VALUE
>>> dis.dis(absolute_1)
4 0 LOAD_FAST 0 (path)
3 LOAD_ATTR 0 (startswith)
6 LOAD_CONST 1 ('/')
9 CALL_FUNCTION 1
12 POP_JUMP_IF_TRUE 28
5 15 LOAD_CONST 1 ('/')
18 LOAD_FAST 0 (path)
21 BINARY_ADD
22 STORE_FAST 0 (path)
25 JUMP_FORWARD 0 (to 28)
6 >> 28 LOAD_FAST 0 (path)
31 RETURN_VALUE
These functions are actually not identical in their computation - only their result.> 1) the former function does not know its own name
If you think that is really important (hint: it's not [from a lisper perspective, anyway]), Python thankfully allows you to do this:
>>> absolute_0.__name__
'<lambda>'
>>> absolute_0.__name__ = '<lambda "absolute_0">'
>>> absolute_0.__name__
'<lambda "absolute_0">'
> 2) the latter function can be documented with a docstring >>> absolute_0.__doc__
>>> absolute_0.__doc__ = 'Return the absolute unix path from a given path name'
>>> help(absolute_0)
Help on function <lambda "absolute_0">:
<lambda "absolute_0">(path)
Return the absolute unix path from a given path name
Of course the only reason you can't put docstrings on a lambda function in python is because the forced indentation of code and implicit return with no indented block available is what Guido went with for Lambda.> Considering that the creator of the Python language considered getting rid of lambdas
Guido is not a proponent of functional programming in general and claims that map, reduce, and filter are so much harder to understand than list comprehensions (which implement some common map, reduce, and filter, operations with special optimized syntax) that he tried to get them removed from the language too. Thankfully for us users of the language, this view did not win through and we can still use map, reduce, and filter in python, if we choose.