def f(ham: str, eggs: str = 'eggs') -> str:
print("Annotations:", f.__annotations__)
print("Arguments:", ham, eggs)
return ham + ' and ' + eggs
Run Code Online (Sandbox Code Playgroud)
在上面的代码块中,来自https://docs.python.org/3.5/tutorial/controlflow.html#documentation-strings
我的问题是关于-> str上面的代码块中的。它有什么作用 ?
| 归档时间: |
|
| 查看次数: |
17719 次 |
| 最近记录: |