tests/attributes_instance_used_by_subclass.py | raw changeset files shortlog |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/attributes_instance_used_by_subclass.py Mon Mar 21 01:25:11 2011 +0100 1.3 @@ -0,0 +1,14 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +class C: 1.7 + def __init__(self): 1.8 + self.x = 456 1.9 + 1.10 +class D(C): 1.11 + def f(self): 1.12 + return self.x 1.13 + 1.14 +d = D() 1.15 +result_456 = d.f() 1.16 + 1.17 +# vim: tabstop=4 expandtab shiftwidth=4