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-April/022204.html below:

[Python-Dev] RE: Re: PEP 285: Adding a bool type

[Python-Dev] RE: Re: PEP 285: Adding a bool type [Python-Dev] RE: Re: PEP 285: Adding a bool typeGuido van Rossum guido@python.org
Wed, 03 Apr 2002 13:58:38 -0500
> Having canonical True and False values would lead newcomers
> to compare to them. This would work, for example:
> 
>   DONE = y and (x > y)
>   ...
>   if DONE is False:
>      ...
> 
> On the other hand, this wouldn't (unless y is a boolean):
> 
>   DONE = (x > y) and y
>   ...
>   if DONE is False:
>      ...
> 
> Of course, it works either way if you replace "DONE is False"
> with "not DONE".

Tutorial should point this out.  It's poor coding style even in
languages that do have strict Booleans, so I think it's a good idea to
nip this one in the bud.

> Or if you replace "y" with "bool(y)".

What a waste to write "if bool(y) == True" instead of "if y" ... :-(

--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