I forgot the reason that I had at the time, but I looked again and I think what must be happening is that it's returning false because 2 is not in [], and then it short-circuits there and never evaluates the function. I can't think of any other reason why the exception is not being raised.
Now that I'm home and able to test out that theory, I think it's likely the reason, as "2 in []" does indeed return False. (I couldn't remember if that was even a valid boolean test in Python.)
Comments 7
I'm on my phone, otherwise I'd check it.
Reply
Why?
Reply
Reply
Reply
Reply
Leave a comment