I have switch_them = True
inside the if __name__ == '__main__'
and Pylint marks it with Constant name "switch_them" doesn't conform to UPPER_CASE naming style Pylint(C0103:invalid-name)
.
The variable changes its value depending on entering another if
nested inside.
If I write instead switch_them: bool = True
, then Pylint doesn’t complain about it.
Question: Why is that?
Note that, with the type hint in this line, Pylint still has the same complain in the line where switch_them
gets its value changed if condition: switch_them = False
.
Should I change to upper case? I suppose putting the bool
type hint on all assignments to switch_them
is not proper style.