From 697be73ae820a076f6803820038c830dec3c966d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 2 Apr 2017 00:43:05 +0100 Subject: [PATCH] less absurd --- test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() -- 2.30.2