Mercurial > magic
annotate Closure @ 244:eee52d5a4af8 default tip
created
| author | 127.0.0.1 |
|---|---|
| date | Sun, 30 Jun 2013 11:08:33 +0200 |
| parents | bccd43768b5f |
| children |
| rev | line source |
|---|---|
| 106 | 1 {{{#!python |
| 107 | 2 def function_factory(): |
| 3 variable = [] | |
| 106 | 4 def function(): |
| 107 | 5 variable.append(1) |
| 106 | 6 return variable |
| 7 return function | |
| 8 | |
| 107 | 9 function1 = function_factory() |
| 10 function2 = function_factory() | |
| 11 print function1() | |
| 12 print function1() | |
| 13 print function2() | |
| 14 }}} | |
| 15 ---- | |
| 16 {{{ | |
| 17 [1] | |
| 18 [1, 1] | |
| 19 [1] | |
| 106 | 20 }}} |
