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


如题又如图

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM