会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
Loading
DuKe渡客
傲慢与偏见
博客园
首页
新随笔
管理
2022年2月6日
Python 函数中箭头 (->)的用处
摘要: Python 3 → 是函数注释的一部分,表示函数返回值的类型。 def useful_function(x) -> int: # Useful code, using x, here return x 可以通过函数的 annotations 看到。 >>> def useful_function(
阅读全文
posted @ 2022-02-06 13:56 DuKe渡客
阅读(782)
评论(0)
推荐(0)
编辑
公告