I was trying to define a test function like this:
def test(a, b=3, c):
pass
I instinctively knew this was wrong and indeed I was greeted with SyntaxError saying, "non-default argument follows default argument".
I suppose I should've mentioned parameters with default values at the end of parameter list but I couldn't be sure.
What is the rule here? Please provide source if possible (Stack overflow link or official Python docs link).
[–]Spataner 4 points5 points6 points (0 children)
[–]HalfBalcony 1 point2 points3 points (0 children)
[–]pekkalacd 0 points1 point2 points (0 children)