pylint icon indicating copy to clipboard operation
pylint copied to clipboard

Add message `name-is-parameter-and-nonlocal`

Open mbyrnepr2 opened this issue 3 years ago • 0 comments

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

mbyrnepr2 avatar Jun 06 '22 19:06 mbyrnepr2