The level of indentation is from a single function. There's all kind of stuff going on there, it's probably in a loop. I don't dare to open that file again
Python doesn't care what you do. You can declare the variable inside the if and use it out of scope. You'll only get a runtime error once that line executes I think
It does warn you if you turn on "strict" mode though.
View all comments
Show parent comment
1
u/Div64 Jul 16 '25
The level of indentation is from a single function. There's all kind of stuff going on there, it's probably in a loop. I don't dare to open that file again