这是不是python中新的语法?
巴扎黑
巴扎黑 2017-04-17 17:44:29
0
1
199

代码如下图,请问foo这个函数定义时候的a:int是什么意思?我在看直播的时候,主播说是可以限制形参a的类型,然而现在看来并不是这样。怎么回事呢?谢谢!

巴扎黑
巴扎黑

reply all(1)
Ty80

https://docs.python.org/3/library/typing.html

Python 3.5.1 new type hint syntax.
It can’t be restricted, it can only be prompted.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template