On Tue, May 15, 2018 at 12:52:42AM +0000, Steven D'Aprano wrote: > But you miss the point that even if = versus == errors are picked up by > code reviews or tests, they are still software bugs. Your *process* > (testing and reviews) picked up the bug before they went into production, > but *the bug still was made*.
I do not miss this point. My premise from the beginning was that humans make mistakes, this bug will occur, and most importantly it's no worse than any other bug. Wrong code is wrong code. YOU'RE GOING TO SCREW UP, and you need *SOMETHING* in place to catch that. It may as well also catch this, and it's NOT that hard to do... If you had no other tools, you could write a regex to scan your code for it and review the matches. If you never discovered that this was a well-known pitfall that's one thing, but I've known about it since approximately 1986--it's been around a long time as you yourself say, so there's no excuse for someone now, 30+ years later, not knowing about it and watching out for it... unless they simply don't care about writing working code and so put no effort into learning about such things. The noob argument only reinforces my point--they're going to screw up all manner of things, until they learn not to... The noob argument is only a worse example of the same reason why we have software development process (and mentors). If you're in the unfortunate position you described, where you don't have peer review, then you need to employ good proccess EVEN MORE, because you have only yourself to rely on. If you don't employ it, it's pretty much a guanrantee that your software quality will be sub par, unless you are a true superstar. [They exist, I've come to know a small handful. Unfortunately I am not one of them.] Seperately, I asserted that you can, if you really want to, learn to not make this mistake, BUT IT'S NOT RELEVANT TO MY POINT. In life we learn to stop making all manner of mistakes, and reduce the frequency of others. In nearly half a century of life, I've NEVER made the mistake of putting my hand on a hot stove burner, because I've learned that it's dangerous, and take extra care around hot stove burners. To me this bug is exactly the same. Likewise I'm POSITIVE there are types of mistakes that YOU never make, though this bug may not be one of them. I'm certain it can be one that you learn to not make, if you exert the required effort, whatever it may be *for you*. But I must admit that neither of us can conclusively prove the other wrong, and you will likely believe whatever you've convinced yourself of already, just as I do, and that's fine. -- https://mail.python.org/mailman/listinfo/python-list