PEP 285: Adding a bool type

Dan Bishop danb_83 at yahoo.com
Sat Apr 6 18:17:20 EST 2002


"Jimmy Retzlaff" <jimmy at retzlaff.com> wrote in message news:<mailman.1017523442.6833.python-list at python.org>...
> Greg Weeks wrote:
> > I would, though, be happy to see built-in variables bound to 0 and 1.
> 
> I assume you mean that the only change would be to implicitly have
> built-ins like:
> 
> False = 0
> True = 1
> 
> There is a trap with this approach in that some people will come to
> conceptualize False/True as being instances of a Boolean type, even
> though they are not. Consider code like:
> 
> if MyCoolFunction(12.3) == True:
> 	print 'cool'

People who write code like that (even in languages with a real boolean
type) deserve to have their programs not work.



More information about the Python-list mailing list