A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-March/020810.html below:

[Python-Dev] For review: PEP 285: Adding a bool type

[Python-Dev] For review: PEP 285: Adding a bool typeGuido van Rossum guido@python.org
Fri, 08 Mar 2002 17:44:53 -0500
> > 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