from proto import Proto p = Proto() print p.getstring('foo') #f = p.getobject('foo') #print f #print f.__str__ print p.foo(p) def plonk(gwar): return '42' p.getstring=plonk print p.foo(p)