From: Ian Jackson Date: Sat, 1 Apr 2017 23:43:05 +0000 (+0100) Subject: less absurd X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/commitdiff_plain/697be73ae820a076f6803820038c830dec3c966d?hp=4ee8a69800373b73f6b1a573c333511af8ce26f7 less absurd --- diff --git a/test.py b/test.py index e1a1568..d2e727c 100755 --- a/test.py +++ b/test.py @@ -1,5 +1,7 @@ #!/usr/bin/python3 +from functools import partial + def hi(th, x): print('hi %s %s' % (th, x)) @@ -8,7 +10,7 @@ def rt(): g = { } while len(g) < 3: newthing = object() - newfunc = lambda x: hi(newthing, x) + newfunc = partial(hi, newthing) g[newthing] = newfunc rt()