-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
C: undefined-variableIssues related to 'undefined-variable' checkIssues related to 'undefined-variable' checkFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds investigation 🔬A bug or crash where it's not immediately obvious what is happenningA bug or crash where it's not immediately obvious what is happenning
Description
Current problem
- I have a long list of keywords to a method, that I want to define for type hints
- I need to pass these to another method as a dictionary, using
locals()
- pylint detects possibly unused variables, but not arguments
Desired solution
- pylint should extend the logic used around unused argument and variable definitions to consider arguments as potentially unused as well
Additional context
Here is an example function that makes use of local scope variables and arguments.
def example(arg_a='a', arg_b='b'): # unused-argument
"""An example function."""
var_c = 'c' # potentially-unused-variable
return locals() # {'arg_a': 'a', 'arg_b': 'b', 'var_c': 'c'}
Metadata
Metadata
Assignees
Labels
C: undefined-variableIssues related to 'undefined-variable' checkIssues related to 'undefined-variable' checkFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds investigation 🔬A bug or crash where it's not immediately obvious what is happenningA bug or crash where it's not immediately obvious what is happenning