>>645
こんな感じのことが出来るってことだろ

T = type('T', (), {'x':1, 'f':lambda self,y: self.x + y})
a = T()
print a.f(1)