I have couple of functions on a python code and I want to use value hints. This function does not give me any errors:
def function1(self, a: int, b: int = 0):
But when I want to add another parameter to the function it gives me an error:
def function1(self, a: int, b: int = 0, c: int):
SyntaxError: non-default argument follows default argument
Do you know if there is any way to solve this, so that I can have a non-default argument following a default argument?
cbut letbtake the default? If you wantcto be keyword-only see e.g. stackoverflow.com/a/37829651/3001761, but this isn't related to the type hints - you'd have the same problem without them.