# HG changeset patch # User Paul Boddie # Date 1531772457 -7200 # Node ID 263b43304dca7e737916e58669ea3108451993e3 # Parent 0687e5d1ed801a4029e58d0b6b3deeb52fd044b0 Added some comments identifying the nature of the tested operations. diff -r 0687e5d1ed80 -r 263b43304dca tests/methods_rebound.py --- a/tests/methods_rebound.py Thu Jul 12 17:14:37 2018 +0200 +++ b/tests/methods_rebound.py Mon Jul 16 22:20:57 2018 +0200 @@ -22,17 +22,30 @@ e = E() +# Normal method access and invocation. + print c.f.__name__ # f print c.f() # <__main__.C instance> # 123 + +# Access and call assigned bound method. + print d.f.__name__ # wrapper print d.f() # <__main__.C instance> # 123 +# Access and call assigned function. + print e.f.__name__ # fn print e.f() # 456 + +# Access details of assigned method. + print e.g.__name__ # f +# Attempt to call method belonging to another class via an incompatible +# instance. In Python, this would be an unbound method call attempt. + try: print e.g() except TypeError: