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