In a loop body, conditionals below does not always run before conditionals above
for example: statement_2 does not necessarily run after statement_1
while condition_1:
if condition_2:
statement_1
else:
statement_2
@bitglue
I think treating all variables defined in other branches as defined can silence the warning.
I have no opinions on whether doing this can be justified by the reported case, though.
@asmeurer
I said false positive because Pyflakes warned of code that can be run in the python interpreter. Maybe I have used the term incorrectly.
Also, at least to me, the problem seems to be more clear now. I can update the original report if needed.
In a loop body, conditionals below does not always run before conditionals above
for example: statement_2 does not necessarily run after statement_1
while condition_1:
if condition_2:
statement_1
else:
statement_2
@bitglue
I think treating all variables defined in other branches as defined can silence the warning.
I have no opinions on whether doing this can be justified by the reported case, though.
@asmeurer
I said false positive because Pyflakes warned of code that can be run in the python interpreter. Maybe I have used the term incorrectly.
Also, at least to me, the problem seems to be more clear now. I can update the original report if needed.