[Python-Dev] switch-based programming in Python

Greg Ewing greg@cosc.canterbury.ac.nz
Thu, 15 Nov 2001 18:47:20 +1300 (NZDT)


Donald Beaudry <donb@abinitio.com>:

> In a for or while, the else clause only gets executed when
> the statement terminates "normally" (not due to a break).  Following
> this model, one might expect the else clause associated with a 'when'
> statement to be executed whenever a when's in caluse terminates
> normally.  But what does "normally" mean in this context?

No, please, don't try to make it work like the loops do!  By the
principle of least astonishment when coming from other languages, that
would be a nightmare.

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