*blink* That's neat.

Greg Ewing greg at cosc.canterbury.ac.nz
Tue May 30 22:11:27 EDT 2000


Niels Diepeveen wrote:
> 
> Counterintuitive semantics are a far greater problem than
> unfamiliar syntax.

I don't think the counterintuitive semantics here are
in the definitions of 'and' and 'or'. The meaning of 
the Python expression '1 or 2' bears no resemblance
to anything in everyday experience, but not because
of the meaning of 'or'. Rather, it's because of the
way Python is willing to coerce anything at all into
a boolean.

I ses this more as an argument in favour of having
a proper boolean type which is clearly separated from
the other types. If Python had that, things like
'if a == 1 or 2' would produce a type error instead
of doing something unexpected.

-- 
Greg Ewing, Computer Science Dept,
+--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-list mailing list