Skip to content

Commit 658af1b

Browse files
committed
Closure
1 parent 2b11ea9 commit 658af1b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ Closure
538538
-------
539539
**We have a closure in Python when:**
540540
* **A nested function references a value of its enclosing function, and then**
541-
* **the enclosing function returns the nested function.
541+
* **the enclosing function returns the nested function.**
542542

543543
```python
544544
def get_multiplier(a):
@@ -554,6 +554,7 @@ def get_multiplier(a):
554554
```
555555

556556
* **If multiple nested functions within enclosing function reference the same value, that value gets shared.**
557+
* **To dynamicaly acces functions first free variable use `'<function>.__closure__[0].cell_contents`'.**
557558

558559
#### Or:
559560
```python

0 commit comments

Comments
 (0)