Update explanations
Update explanation in digitize Update explanation in delay Update explanation in curry Update explanation in compose_right Update explanation in compose
This commit is contained in:
@ -5,7 +5,7 @@ tags: function,intermediate
|
||||
|
||||
Curries a function.
|
||||
|
||||
Use `partial()` to return a new partial object which behaves like `fn` with the given arguments, `args`, partially applied.
|
||||
Use `functools.partial()` to return a new partial object which behaves like `fn` with the given arguments, `args`, partially applied.
|
||||
|
||||
```py
|
||||
from functools import partial
|
||||
@ -16,7 +16,7 @@ def curry(fn, *args):
|
||||
|
||||
```py
|
||||
add = lambda x, y: x + y
|
||||
add10 = curry(sum, 10)
|
||||
add10 = curry(add, 10)
|
||||
|
||||
add10(20) # 30
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user