A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-June/066509.html below:

[Python-Dev] Switch statement

[Python-Dev] Switch statement [Python-Dev] Switch statementGreg Ewing greg.ewing at canterbury.ac.nz
Sun Jun 25 06:48:14 CEST 2006
Phillip J. Eby wrote:

> 1. "case (literal|NAME)" is the syntax for equality testing -- you can't 
> use an arbitrary expression, not even a dotted name.

That's too restrictive. I want to be able to write
things like

   class Foods:
     Spam = 1
     Eggs = 2
     Ham = 3

  ...

     switch f:
       case Foods.Spam:
         ...
       case Foods.Eggs:
         ...

--
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4