On Codewars.com I encountered the following task:
Create a function add that adds numbers together when called in succession. So add(1
add
add(1
Simply:
class add(int): def __call__(self, n): return add(self + n)