I have a function that utilizes both a default parameter and *args:
def greeting(name, *args, exclamation='yo!'):
for arg in args:
print(name, arg, exclamation)
This seems to work fine. However, when I check it with flake8, it returns:
1 col 38| E901 SyntaxError: invalid syntax
I am stickler for both following correct practice and having my checks clear. Am I doing this wrong? Is a different method standard?
exclamationwould be a keyword-only argument, meaning it'd have to passed likegreeting('Joe', some, args, exclamation='!'). Useful, but not necessarily what you want.likejust before the code :s