Constant name doesn't conform to UPPER_CASE naming style

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.

The variable is not a constant, so I think Pylint is wrong. I don’t use it so I won’t say more.

Relevant pylint issue: Make ``invalid-name`` only check internal consistency for module level variables · Issue #3585 · pylint-dev/pylint · GitHub