Skip to content

Add message name-is-parameter-and-nonlocal #6882

@mbyrnepr2

Description

@mbyrnepr2

Current problem

The following produces a SyntaxError:

def tomato(is_tasty: bool = True):
    nonlocal is_tasty
python example.py
  File "/Users/markbyrne/programming/example.py", line 2
    nonlocal is_tasty
    ^^^^^^^^^^^^^^^^^
SyntaxError: name 'is_tasty' is parameter and nonlocal

Desired solution

Create a new message in Pylint and emit it in this scenario indicating the error.

Additional context

No response

Metadata

Metadata

Assignees

Labels

CheckersRelated to a checkerEnhancement ✨Improvement to a component

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions