Which would be the suitable base error in Python for limiting the number of args passed in a function.
I’d like to limit it to 2 argument as follows:
def func(*args):
if len(args) == 1:
# Do one thing
elif len(args) == 2:
# Do another thing
else:
## raise an error ##
>Solution :
I think TypeError would be okay. This suggests the input is structurally incorrect.
Doc here