Variable used before assignmentPYL-E0601
This local variable name is being used before it is defined. This will throw an UnboundLocalError.
It is recommended to refactor this code.
Bad practice
def used_before_assignment(a):
if x == a: # x is defined in the next line
for x in [1, 2]:
pass
Recommended
def correct_usage(a):
for x in [1, 2]:
if x == a:
pass