[python] python函数定义里后边那个箭头是干嘛的

时间:2020-04-04 19:27:21   收藏:0   阅读:144

如题又如图

def add(x:int, y:int) -> int:
    return x + y

答:

是注释。前边的:int也是。见:

https://python3-cookbook.readthedocs.io/zh_CN/latest/c07/p03_attach_informatinal_matadata_to_function_arguments.html

原文:https://www.cnblogs.com/hugetong/p/12632856.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!