PEP 285: Adding a bool type

Carel Fellinger cfelling at iae.nl
Sat Mar 30 18:12:03 EST 2002


Guido van Rossum <guido at python.org> wrote:
...
>     I'm particularly interested in hearing your opinion about the
>     following three issues:

As you seem more interested in votes this time around then in arguments:)
I'll try to restrict my self to yes and no anwsers.

>     1) Should this PEP be accepted at all.

yes (I always missed it)

>     2) Should str(True) return "True" or "1": "1" might reduce
>        backwards compatibility problems, but looks strange to me.
>        (repr(True) would always return "True".)

str(True) == "True"  (more readable at the interpreter prompt)

>     3) Should the constants be called 'True' and 'False'

definitely 'True' and 'False'

>     Minor additional issues:

>     4) Should we strive to eliminate non-Boolean operations on bools
>        in the future, through suitable warnings, so that e.g. True+1

no.

The first time I came across "days + isleap(year)" I found it higly
puzzling (I was raised with strict typing), but now that I'm used to
it I wouldn't want to loose it.


>     5) Should operator.truth(x) return an int or a bool.  Tim Peters

assuming its result can be used in integer expressions, it should
return a canonical truth value, so bool (preferably called 'truth')


-- 
groetjes, carel



More information about the Python-list mailing list