【发布时间】:2016-07-16 00:49:17
【问题描述】:
def f(ham: str, eggs: str = 'eggs') -> str:
print("Annotations:", f.__annotations__)
print("Arguments:", ham, eggs)
return ham + ' and ' + eggs
上面的代码块来自https://docs.python.org/3.5/tutorial/controlflow.html#documentation-strings
我的问题是关于上述代码块中的-> str。它有什么作用?
【问题讨论】:
标签: python