for i in ('args', []), ('kwargs', {}): if locals()[i[0]]: val = locals()[i] else: val = i[1] setattr(self, i[0], i[1])