Commit | Line | Data |
---|---|---|
4ee8a698 IJ |
1 | #!/usr/bin/python3 |
2 | ||
697be73a IJ |
3 | from functools import partial |
4 | ||
4ee8a698 IJ |
5 | def hi(th, x): |
6 | print('hi %s %s' % (th, x)) | |
7 | ||
8 | def rt(): | |
9 | global g | |
10 | g = { } | |
11 | while len(g) < 3: | |
12 | newthing = object() | |
697be73a | 13 | newfunc = partial(hi, newthing) |
4ee8a698 IJ |
14 | g[newthing] = newfunc |
15 | ||
16 | rt() | |
17 | print(repr(g)) | |
18 | for v in g.values(): | |
19 | v(24) |