class User(object): def buy(self, what): if isinstance(what, (list, tuple)): for smth in what: smth.buy(self) else: what.buy(self) class Ware(object): is_bought = False def buy(self, who): self.is_bought = who