Intellisense not recognising type hinting for python 3

情到浓时终转凉″ 提交于 2019-12-12 10:44:14

问题


I would like to use Visual Studio and see intellisense using type hints, for example in the function argument list, to workout the type of a variable.

This can be achieved through isinstance(param,type) statements, but I wonder if we can get it to work without these additional statements:

Note: I have tried Visual Studio with Python Tools for Visual Studio and also the early 2017 Visual Studio Preview, that has python support built in, but neither seem to appreciate type hints.


回答1:


After confirmed, this result is by designed, please check this: 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: The result is as expected currently, because PTVS does not yet support type hints to drive code completion. The following issue is tracking that feature: #82.



来源:https://stackoverflow.com/questions/44901572/intellisense-not-recognising-type-hinting-for-python-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!