From: Ian Jackson Date: Mon, 3 Apr 2017 12:05:41 +0000 (+0100) Subject: remove example demonstrating daft variable scoping/lifetime X-Git-Tag: hippotat/1.0.0~55^2~114 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=hippotat.git;a=commitdiff_plain;h=357622f5c96e2c6301deb54d399325037246dd13 remove example demonstrating daft variable scoping/lifetime --- diff --git a/test.py b/test.py deleted file mode 100755 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)