tests/attributes_class_copy_from_other.py | raw changeset files shortlog |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/attributes_class_copy_from_other.py Sun Jun 03 00:42:45 2012 +0200 1.3 @@ -0,0 +1,15 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +class C: 1.7 + def method(self): 1.8 + return 123 1.9 + 1.10 +class D: 1.11 + method = C.method # won't rebind to D 1.12 + 1.13 +c = C() 1.14 +d = D() 1.15 +result_123 = c.method() 1.16 +result2_123 = d.method(c) # need D instance to function 1.17 + 1.18 +# vim: tabstop=4 expandtab shiftwidth=4