Skip to content

Using the collecting variable of iterable unpacking causes "used before definition" error #3543

@mcpower

Description

@mcpower

Using the example from the PEP:

a, *b, c = range(5)
print(b)

produces

{
	"owner": "_generated_diagnostic_collection_name_#0",
	"code": "use-before-def",
	"severity": 4,
	"message": "'b' used before definition",
	"source": "Python",
	"startLineNumber": 2,
	"startColumn": 7,
	"endLineNumber": 2,
	"endColumn": 8
}

Environment data

  • VS Code version: 1.29.1
  • Extension version (available under the Extensions sidebar): 2018.11.0
  • OS and version: Windows 10 1803
  • Python version (& distribution if applicable, e.g. Anaconda): CPython 3.7.0
  • Python Language Server version: 0.1.65.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions