Skip to content

python3本地调试会报错 #206

Closed
Closed
@jlhxxxx

Description

@jlhxxxx

🐛 Bug Report

设置python3为默认语言,使用leetcode默认定义在本地调试会报错:undefined name name,这可能应该算python调试插件的问题

To Reproduce

提交代码至leetcode没有问题。
就是本地debug报错。屏蔽flake8(F821)也不行。

class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:

报错信息:

{
	"resource": "/d:/work/Workspaces/MYGitHub/leetcode/1.两数之和.py",
	"owner": "python",
	"code": "F821",
	"severity": 8,
	"message": "undefined name 'List'",
	"source": "flake8",
	"startLineNumber": 30,
	"startColumn": 28,
	"endLineNumber": 30,
	"endColumn": 28
}

Expected behavior

可以正常调试,不报错。

Your Environment

  • os: win7_x64
  • python version: 3.7.2
  • extension settings: ms-python.python-2019.2.5558
  • nodejs version: 10.15.3
  • vscode version: 1.32.1
  • extension version: ms-python.python-2019.2.5558

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions