Having the following function:
def foo(x=1):
print(x)
It is clearly stated in PEP 8 that no spaces should be used around the =
sign when used to indicate a keyword argument or a default parameter value.
If we want to type-annotate the x
parameter. How should we do it?
def foo(x:int=1):
def foo(x: int=1):
def foo(x: int = 1):
Is there a preferred way? Or even better, is it specified in some PEP? Did not find it in PEP 484.