When I write Python it's an absolute hard line requirement to run it through Pylint and Pyright. They catch sooooo many issues you'd have to be a complete idiot not to do this (many people are unfortunately).
In this case Pylint will tell you about this mistake:
https://pylint.pycqa.org/en/latest/user_guide/messages/warni...