Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
VSCode Python 3+;Microsoft extension没有';t在传入不同类型的参数时发出警告_Python_Visual Studio Code - Fatal编程技术网

VSCode Python 3+;Microsoft extension没有';t在传入不同类型的参数时发出警告

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

我正在使用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 5. I don't get any complaint here.
    my_func(5)

PyCharm捕捉到了这一点,但VSCode没有。我想知道我是否需要启用某些功能,或者这是此VSCode扩展的已知问题。

请参阅,谢谢我现在正在使用mypy。尝试使用pylance插件来启用VSCode,您可以启用严格的linting