# Python 3.5+ supports 'type annotations' that can be
# used with tools like Mypy to write statically typed Python:
def my_add(a: int, b: int) -> int:
return a + b
If you think your friends would find this tip useful, please share it with them—I’d really appreciate it. Here's the link: View in browser
308 E. 5th Ave, Vancouver BC V5T 1H4
参考文档:
typing - Support for type hints 类型标注支持
PEP 3107 -- Function Annotations
7.3 给函数参数增加元信息
8.6 Function definitions