class withsomething(object): def __init__(self,other): self.other=other(); def __str__(self): return other.__str__ + super.__str__; @withsomething class withsugar(object): def __str__(self): return " with sugar"; @withsomething class withmilk(object): def __str__(self): return " with milk"; class coffee(object): def __str__(self): return "coffee"; print withmilk(coffee());