> > Absolutely not. I want True == 2 to be False. > > Interesting. so: > operator.truth(2) would be True Yes, this would do exactly the same as bool(2). > but: > 2 == True would be False Just as in C99 (the new updated C standard, not yet in actual use). > and: > bool(2) would be True > > Once again, casting, coercion, comparisons and truth value rear their > fuzzy heads. For the first time, we'll have a standard way to cast an arbitrary value to a normalized truth value. Currently we write "not not x" for that. Now *that* is ugly. Also, you'll be able to use 'is' and 'is not', as follows: if bool(x) is True: ... if bool(y) is not True: ... Not that I endorse this (I still think that anybody who takes a boolean result and then compares it to True is crazy), but it reads like English. :-) --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