#python #sicp
In general, Python style prefers explicit def statements to lambda
expressions, but allows them in cases where a simple function is needed as an
argument or return value.
If you want to change selection, open document below and click on "Move attachment"
1.6 Higher-Order Functionsver, compound lambda expressions are
notoriously illegible, despite their brevity. The following definition is
correct, but many programmers have trouble understanding it quickly.
>>> compose1 = lambda f,g: lambda x: f(g(x))
<span>In general, Python style prefers explicit def statements to lambda
expressions, but allows them in cases where a simple function is needed as an
argument or return value.
Such stylistic rules are merely guidelines; you can program any way you wish.
However, as you write programs, think about the audience of people who might
read your program one day. Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details