String comparison in Python: is vs. ==
- by Coquelicot
I noticed a Python script I was writing was acting squirrelly, and traced it to an infinite loop, where the loop condition was "while line is not ''". Running through it in the debugger, it turned out that line was in fact ''. When I changed it to != rather than 'is not', it worked fine.
I did some searching, and found this question, the top…