VSCode Python 3+;Microsoft extension没有';t在传入不同类型的参数时发出警告
我正在使用VSCode Python 3+和Microsoft的Python扩展。我可以这样做:VSCode Python 3+;Microsoft extension没有';t在传入不同类型的参数时发出警告,python,visual-studio-code,Python,Visual Studio Code,我正在使用VSCode Python 3+和Microsoft的Python扩展。我可以这样做: class Point: def __init__(self): self.x = 0 self.y = 0 def my_func(p: Point): p.x = 5 p.y = 5 def this_func_should_warn(): # my_func takes a Point, but I am passing in
class Point:
def __init__(self):
self.x = 0
self.y = 0
def my_func(p: Point):
p.x = 5
p.y = 5
def this_func_should_warn():
# my_func takes a Point, but I am passing in 5. I don't get any complaint here.
my_func(5)
PyCharm捕捉到了这一点,但VSCode没有。我想知道我是否需要启用某些功能,或者这是此VSCode扩展的已知问题。请参阅,谢谢我现在正在使用mypy。尝试使用pylance插件来启用VSCode,您可以启用严格的linting