Skip to content

Commit cb3b595

Browse files
committed
currying
1 parent 4fff2a5 commit cb3b595

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/modules/lesson08/currying.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ function with a couple parameters pre-set.
1717
Let's go back to the multiplier example we used when learning closures:
1818

1919
```
20-
2120
def multiplier(x):
2221
return x * 3
22+
2323
```
2424

2525
As before, we can use closures to create a multiplier factory, one that
@@ -39,6 +39,7 @@ This one would still be able to work in exactly the same way as the
3939
original function, but now it also allows you to override the default
4040
multiplication by 3 with a different factor:
4141

42+
4243
```
4344

4445
multiplier(4) # The result will be 4 * 3 = 12
@@ -51,8 +52,8 @@ factor, even if it's not changing (unless the factor happens to have the
5152
default value of 3). And there are places, like map that require a
5253
function that takes only one argument!
5354

54-
.. container:: section
55-
:name: real-world-example
55+
Real-world-example
56+
------------------
5657

5758
What if I could create a function, on the fly, that had a
5859
particular factor “baked in”?

0 commit comments

Comments
 (0)