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

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

巴扎黑
巴扎黑

répondre à tous(1)
Ty80

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

Python 3.5.1 nouvelle syntaxe d'indication de type.
Il ne peut pas être restreint, il peut seulement être invité.

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal