gpt4 book ai didi

visual-studio - Intellisense 无法识别 Python 3 的类型提示

转载 作者:行者123 更新时间:2023-12-04 06:15:13 24 4
gpt4 key购买 nike

我想使用 Visual Studio 并使用类型提示(例如在函数参数列表中)查看智能感知来测试变量的类型。

enter image description here

这可以通过 isinstance(param,type) 实现语句,但我想知道我们是否可以在没有这些附加语句的情况下使其工作:

enter image description here

注意:我已经尝试过 Visual Studio 和用于 Visual Studio 的 Python 工具以及 2017 年初的 Visual Studio 预览版,它内置了 Python 支持,但似乎都不喜欢类型提示。

最佳答案

经确认,此结果是设计的,请检查:Python 3.6: using type hints to describe a variable in the function argument list and the Quick Info of this variable display ‘unknown type’

Int19h:结果与当前预期一致,因为 PTVS 尚不支持驱动代码完成的类型提示。以下问题正在跟踪该功能:#82 .

关于visual-studio - Intellisense 无法识别 Python 3 的类型提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44901572/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com