问题分析
Python属于动态强类型语言,动态类型语言是在运行期间做数据类型检查,所以IDE无法判断返回值的数据类型,从而无法自动补全。
解决方案
官网给出了一些解决方案:官网解决方案
PyCharm 中的类型提示
在这个部分:
- 关注 PEP484
- 指定参数类型
- 指定返回类型
- 指定局部变量和属性的类型
- Python 存根
- 文档字符串的旧类型语法
- 指定局部变量的类型
- 指定字段类型
- 指定返回类型
- 指定参数类型
- 转换评论
Python属于动态强类型语言,动态类型语言是在运行期间做数据类型检查,所以IDE无法判断返回值的数据类型,从而无法自动补全。
官网给出了一些解决方案:官网解决方案
在这个部分:
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
You can find more information in our Privacy Policy and .