You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Methods in which the amount of arguments passed needs to be checked in order to decide its behavior (e.g. polar()) should use *args and **kwargs instead of checking only the first argument. Checking if the first argument is there assumes unnamed arguments only, forgetting about named arguments.
For example:
deff(a=0, b=0):
ifnota:
print("No arguments")
else:
print("Arguments")
f(b=10)
>>>Noarguments# THIS IS WRONG! Clearly an argument was given
The text was updated successfully, but these errors were encountered:
Methods in which the amount of arguments passed needs to be checked in order to decide its behavior (e.g.
polar()
) should use *args and **kwargs instead of checking only the first argument. Checking if the first argument is there assumes unnamed arguments only, forgetting about named arguments.For example:
The text was updated successfully, but these errors were encountered: