[Python-Dev] For review: PEP 285: Adding a bool type
M.-A. Lemburg
mal@lemburg.com
Fri, 08 Mar 2002 20:36:07 +0100
Just found another argument:
Guido van Rossum wrote:
>
> When showing people comparison operators etc. in the interactive
> shell, I think this is a tad ugly:
>
> >>> a = 13
> >>> b = 12
> >>> a > b
> 1
> >>>
>
> If this was:
>
> >>> a > b
> True
> >>>
>
> it would require one millisecond less thinking.
and then they do:
>>> (a > b) * 10
10
or
>>> True * 10
10
>>> False * 10
0
If you want to dive into logic here, the only correct output
would be:
>>> True * 10
True
>>> False * 10
False
However, this would break even more code... your bool
type is much more like a bit type (or would have to behave
like one in order to maintain backwards compatibility).
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting: http://www.egenix.com/
Python Software: http://www.egenix.com/files/python/