tests/nested_calls.py | raw changeset files shortlog | method-wrapper-for-context |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/nested_calls.py Fri Feb 17 16:30:37 2017 +0100 1.3 @@ -0,0 +1,15 @@ 1.4 +class C: 1.5 + def __init__(self, x): 1.6 + self.x = x 1.7 + 1.8 + def value(self): 1.9 + return self.x 1.10 + 1.11 + def length(self): 1.12 + return self.double(self.value()) 1.13 + 1.14 + def double(self, x): 1.15 + return x * 2 1.16 + 1.17 +c = C(3) 1.18 +print c.length() # 6