Skip to content

Commit cb9050c

Browse files
Clarify callable wording in functions lecture
1 parent 7499474 commit cb9050c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lectures/functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ Notes
360360

361361
Now, there are several ways that we can simplify the code above.
362362

363-
For example, we can get rid of the conditionals all together by just passing the desired generator type *as a function*.
363+
For example, we can get rid of the conditionals all together by just passing the desired generator type as a function, method, or other callable object.
364364

365365
To understand this, consider the following version.
366366

@@ -381,9 +381,9 @@ plt.show()
381381
Now, when we call the function `generate_data()`, we pass `rng.uniform`
382382
as the second argument.
383383

384-
This object is a *function*.
384+
This object is a *callable* — that is, an object that can be called using parentheses.
385385

386-
When the function call `generate_data(100, rng.uniform)` is executed, Python runs the function code block with `n` equal to 100 and the name `generator_type` "bound" to the function `rng.uniform`.
386+
When the function call `generate_data(100, rng.uniform)` is executed, Python runs the function code block with `n` equal to 100 and the name `generator_type` "bound" to the callable `rng.uniform`.
387387

388388
* While these lines are executed, the names `generator_type` and `rng.uniform` are "synonyms", and can be used in identical ways.
389389

0 commit comments

Comments
 (0)