class A(object): def __init__(self): self.foo = 'foofoo' def print_foo(self): print self.foo pf = A().print_foo pf() # output: foofoo