No Boolean type in "types"

Mikael Olofsson mikael at isy.liu.se
Tue Jun 13 08:55:13 EDT 2000


On 13-Jun-00 Thomas Mangin wrote:
 >  I knew this, sorry I wasn't clear enough,
 >  Considering a "structural" point of view, having true and defined in a
 >  standard way
 >  and being able to "indicate" that the type is Boolean is a nice programming
 >  practice.
 >  In C one will use TRUE and FALSE. Those define are no more than integer too
 >  but help
 >  code readability. That is my point.

As I wrote earlier, there is no single boolean type. Integers, strings, 
lists, dictionaries, and even your own classes can be used as booleans.
You can do

  if {}:
    print 'Shouldn't happen!'

Defining a single boolean type is not only unnecessary, it's plain wrong.

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    13-Jun-00
Time:    14:50:39

This message was sent by XF-Mail.
-----------------------------------------------------------------------



More information about the Python-list mailing list