#!/usr/local/bin/python2 class C(object): def __init__(self): self.i = 1 class B(object): def d(self): print self.i c = C() c.d = B().d