Paul Graham wrote: > but it is considered ugly, and the canonical way to > do this seems to be by defining a class: > > class foo: > def __init__(self, n): > self.n = n > > def __call__(self, i): > self.n += i > return self.n ^^^ I think you mean: return self Cheers, f.