On Sun, 25 Jan 2009 03:07:04 +0200, Oktay Şafak wrote: > The reason is that when > someone writes (-1 == True) he is clearly, definitely, absolutely asking > for a boolean comparison, not a numerical one.
If I wrote (-1 == True), and I'm not sure why I would, I would expect to get the answer False, because -1 is not equal to True. Many things have truth values which are true but not equal to True. If I wanted bool(-1) == True, I'd write bool(-1) == True. Or, if I was in a whimsical mood, I'd write: ((bool(-1) == True) == True) == True # oh when to stop??? just to illustrate the foolishness of doing boolean equality comparisons like that. -- Steven -- http://mail.python.org/mailman/listinfo/python-list