Consider this small function:
def test():
x = 1
x = 2
x = 3
return x + 1
Apparently, the first two assignments to x have no effect here and can be removed. Yet surprisingly, pylint/flake8/ruff don't produce any warnings about it (at least with the default config). Is there any particular reason for this?
pylintspecifically. It seems that the three most popular Python linters ignore this issue, so there might be a deeper reason behind it.