> I didn't want to jump on the bandwagon, but... > > It occurs to me that one potential benefit of having a > boolean type is to avoid mistakes like this: > > test = value & MASK > if test == True: > DoSomething() > > Sure, "if bool(test) == True:" does the right thing, but > so does "if test:". You wouldn't have made the mistake > in the first place if you'd thought of that. :-) > > I think at least add something like this should be added > to the description in the PEP: > > def __cmp__(self,other): > return int.__cmp__(self,bool(other)) Absolutely not. I want True == 2 to be False. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4