tests/getattr_instance_methods.py | raw changeset files shortlog |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/getattr_instance_methods.py Sun May 08 18:41:21 2011 +0200 1.3 @@ -0,0 +1,16 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +class C: 1.7 + def x(self): 1.8 + return 1 1.9 + 1.10 +class D: 1.11 + def x(self): 1.12 + return 2 1.13 + 1.14 +c = C() 1.15 +d = D() 1.16 +result_1 = getattr(c, "x")() 1.17 +result_2 = getattr(d, "x")() 1.18 + 1.19 +# vim: tabstop=4 expandtab shiftwidth=4