By misstake I made a variable assignment using two equal signs, like this code:
…
flag == True
…
This error was not notified by the syntax check, but totally ignored during execution of the program.
It happened several times and is easily repeated…
The Python version:
Python 3.10.12
Running Ubuntu 22.04 on an old 64-bit cpu laptop.
Surrounding code was like this
…
pix = pya.pixel(x, y)
Thanks for your response. I have not heard about linter. It seems great. I’m just a bit too naive to believe that Python would secure that compiling the script means that it could handle it.
So I’ll dig into linter Thanks again .
The reason Python doesn’t complain is because it’s not a syntax error–maybe you did want to check if something was equal to True. So the script could indeed handle it just fine. Linters can check for common mistakes that are valid code but possibly logical errors in terms of what you wanted.