<分区> 分区>
我不明白 arg: str 是什么意思
def hello(arg: str):
print(type(arg))
print('do stuff!', arg)
hello('something')
我以为是在指定一个类型,但我试着调用 hello,我没有任何异常。我尝试用 int 调用 hello,没有错误。
我做了一些测试,但我还没有想出任何东西......
知道这是在做什么吗?
马特
<分区> 分区>
我不明白 arg: str 是什么意思
def hello(arg: str):
print(type(arg))
print('do stuff!', arg)
hello('something')
我以为是在指定一个类型,但我试着调用 hello,我没有任何异常。我尝试用 int 调用 hello,没有错误。
我做了一些测试,但我还没有想出任何东西......
知道这是在做什么吗?
马特