[Python-Dev] Re: switch statement

Michael Hudson mwh at python.net
Thu Apr 21 11:30:58 CEST 2005

Shannon -jj Behrens <jjinux at gmail.com> writes:

> On 4/20/05, M.-A. Lemburg <mal at egenix.com> wrote:
>> My use case for switch is that of a parser switching on tokens.
>> mxTextTools applications would greatly benefit from being able
>> to branch on tokens quickly. Currently, there's only callbacks,
>> dict-to-method branching or long if-elif-elif-...-elif-else.
> I think "match" from Ocaml would be a much nicer addition to Python
> than "switch" from C.

Can you post a quick summary of how you think this would work?


  We did requirements and task analysis, iterative design, and user
  testing. You'd almost think programming languages were an interface
  between people and computers.                    -- Steven Pemberton
          (one of the designers of Python's direct ancestor ABC)

More information about the Python-Dev mailing list