class Some: def __init__(self, x): self.x = x s = Some(1) Some.service = lambda self, y: print('do service...', self.x + y) s.service(2) # do service... 3
沒有留言:
張貼留言