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

Mark McEahern marklists at mceahern.com
Wed Apr 3 12:12:58 EST 2002


[Ka-Ping Yee]
> The addition of another type really does change the set of preferred
> truth values from {0, 1} to {0, False, 1, True}.  The typical practicing
> Python programmer who wants to say "true" would have to decide -- for
> each instance -- whether to say "1" or "True".

Nope, the set of preferred truth values would be:

	True, False

You could, of course, continue to use 1, 0 if you like.  In the long run,
why would you?

> And the programmer cannot happily ignore the issue and stick to using
> 0 and 1 [...]

Of course she can.  In the long run, why would she?

> [...] because if comparisons start to return True and False, dealing
> with a mix of four truth values is unavoidable.  This PEP makes me uneasy
> because it causes me to see lots of extra casts in Python's future (not
> to mention confused beginners).

Can you give me just one example of these supposedly necessary 'extra casts'
that is not gratuitous and intentionally sloppy?  I'm too dense to come up
with one on my own.

Hmm, this PEP makes me delighted because I see lots of clean code and happy,
productive beginners.

But, to each his own.

Cheers,

// mark






More information about the Python-list mailing list