1.1 --- a/tests/methods_rebound.py Thu Jul 12 17:14:37 2018 +0200
1.2 +++ b/tests/methods_rebound.py Mon Jul 16 22:20:57 2018 +0200
1.3 @@ -22,17 +22,30 @@
1.4
1.5 e = E()
1.6
1.7 +# Normal method access and invocation.
1.8 +
1.9 print c.f.__name__ # f
1.10 print c.f() # <__main__.C instance>
1.11 # 123
1.12 +
1.13 +# Access and call assigned bound method.
1.14 +
1.15 print d.f.__name__ # wrapper
1.16 print d.f() # <__main__.C instance>
1.17 # 123
1.18
1.19 +# Access and call assigned function.
1.20 +
1.21 print e.f.__name__ # fn
1.22 print e.f() # 456
1.23 +
1.24 +# Access details of assigned method.
1.25 +
1.26 print e.g.__name__ # f
1.27
1.28 +# Attempt to call method belonging to another class via an incompatible
1.29 +# instance. In Python, this would be an unbound method call attempt.
1.30 +
1.31 try:
1.32 print e.g()
1.33 except TypeError: