From 7c9de1fbebbe48f0dce50487e7be735fd70616a1 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 1 Dec 2014 11:36:19 +0100 Subject: [PATCH] Some class lambdas tests too assure that they are working well with instances. --- test/completion/lambdas.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/completion/lambdas.py b/test/completion/lambdas.py index 429bbbba..06b121e5 100644 --- a/test/completion/lambdas.py +++ b/test/completion/lambdas.py @@ -55,11 +55,26 @@ a = lambda: 3 a.__closure__ class C(): - def __init__(self): + def __init__(self, foo=1.0): self.a = lambda: 1 + self.foo = foo + + def ret(self): + return lambda: self.foo + + def with_param(self): + return lambda x: x + self.a() + #? int() C().a() +#? str() +C('foo').ret()() + +index = C().with_param()(1) +#? float() +['', 1, 1.0][index] + def xy(param): def ret(a, b):