1.1 --- a/tests/contexts.py Thu Jul 05 16:00:24 2018 +0200
1.2 +++ b/tests/contexts.py Thu Jul 05 16:01:33 2018 +0200
1.3 @@ -5,6 +5,8 @@
1.4 self.x = x
1.5 self.y = 3
1.6 self.z = "zebra libre"
1.7 + def __len__(self):
1.8 + return len(self.z)
1.9
1.10 c = C([1])
1.11 x = c.x
1.12 @@ -45,3 +47,11 @@
1.13 print b # zebra libre
1.14 print i # __builtins__.str.basestring.__len__
1.15 print i() # 11
1.16 +
1.17 +j = C.__len__
1.18 +k = get_using(j, c)
1.19 +try:
1.20 + print j()
1.21 +except UnboundMethodInvocation:
1.22 + print "j(): invocation of method with class context"
1.23 +print k() # 11