100 super(User, self).__init__(*args, **kwargs)
101
102 @classmethod
103 def create(cls, username, password, is_teacher=False, is_maintainer=False, is_student=False, is_employee=False, is_faculty=False, employee=None, *args, **kwargs):104 if is_faculty or is_teacher:
105 is_employee = True
106 if employee is None:
On defining a keyword argument before variable positional arguments, one can end up in having multiple values passed for the aforementioned parameter in case the method is called with keyword arguments. It is recommended to define keyword arguments after variable positional arguments.
def create_list(double=False, *args): # first argument will end up in `double`
return list(args)
print(create_list(1, 2, 3)) # prints `[2, 3]`
def create_list(*args, double=False):
return list(args)
print(create_list(1, 2, 3)) # prints `[1, 2, 3]`