Add a new positional argument
def __init__(self, a_list, *args, **kwargs): super(MyClass, self).__init__(*args, **kwargs) self._mylist = a_list
Add a new keyword argument
def __init__(self, *args, **kwargs): self._mylist = kwargs.pop('a_list', ['some', 'default', 'list']) super(MyClass, self).__init__(*args, **kwargs)
No comments:
Post a Comment