Oct-23-2020, 08:31 PM
It's warning you that a static analysis can't guarantee that
In this case new_list is only assigned to inside a conditional. If
I suspect the if was only supposed to be for the following line to load the dictionary. But the indentation as written keeps the rest of the function inside until the final return.
new_list
will be properly initialized (or bound) before reaching that line. I think you have an indentation error starting on line 37.In this case new_list is only assigned to inside a conditional. If
words
is set, then the if condition fails and the block is skipped. Execution resumes at line 43. The return will fail because new_list has no value.I suspect the if was only supposed to be for the following line to load the dictionary. But the indentation as written keeps the rest of the function inside until the final return.