在Python3中,我可以做:
# Function with string as input def function(argument: str): return argument
但是我不能:
# Function with optional input def function(argument='default': str): return argument
定义可选参数类型的正确语法是什么?
只需交换默认值和类型的位置