|
@ -537,7 +537,7 @@ creature = Creature() |
|
|
Closure |
|
|
Closure |
|
|
------- |
|
|
------- |
|
|
**We have a closure in Python when:** |
|
|
**We have a closure in Python when:** |
|
|
* **A nested function references a value of its enclosing function, and then** |
|
|
* **A nested function references a value of its enclosing function and then** |
|
|
* **the enclosing function returns the nested function.** |
|
|
* **the enclosing function returns the nested function.** |
|
|
|
|
|
|
|
|
```python |
|
|
```python |
|
|
xxxxxxxxxx