mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 23:00:18 +00:00
Two minor changes to writing/gotchas.
This commit is contained in:
@@ -79,7 +79,7 @@ signal that no argument was provided (:py:data:`None` is often a good choice).
|
||||
When the Gotcha Isn't a Gotcha
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Sometimes you specifically can "exploit" (read: use as intended) this behavior
|
||||
Sometimes you can specifically "exploit" (read: use as intended) this behavior
|
||||
to maintain state between calls of a function. This is often done when writing
|
||||
a caching function.
|
||||
|
||||
@@ -126,7 +126,7 @@ What Does Happen
|
||||
8
|
||||
8
|
||||
|
||||
Five functions are created, but all of them just multiply ``x`` by 4.
|
||||
Five functions are created; instead all of them just multiply ``x`` by 4.
|
||||
|
||||
Python's closures are *late binding*.
|
||||
This means that the values of variables used in closures are looked
|
||||
|
||||
Reference in New Issue
Block a user