chiark
/
gitweb
/
~ian
/
hippotat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6164165
)
remove example demonstrating daft variable scoping/lifetime
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 3 Apr 2017 12:05:41 +0000
(13:05 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 3 Apr 2017 12:05:41 +0000
(13:05 +0100)
test.py
[deleted file]
patch
|
blob
|
history
diff --git
a/test.py
b/test.py
deleted file mode 100755
(executable)
index
d2e727c
..0000000
--- a/
test.py
+++ /dev/null
@@
-1,19
+0,0 @@
-#!/usr/bin/python3
-
-from functools import partial
-
-def hi(th, x):
- print('hi %s %s' % (th, x))
-
-def rt():
- global g
- g = { }
- while len(g) < 3:
- newthing = object()
- newfunc = partial(hi, newthing)
- g[newthing] = newfunc
-
-rt()
-print(repr(g))
-for v in g.values():
- v(24)