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/065874.html below:

[Python-Dev] Switch statement

[Python-Dev] Switch statement [Python-Dev] Switch statementGreg Ewing greg.ewing at canterbury.ac.nz
Mon Jun 12 03:03:34 CEST 2006
Talin wrote:

> Since you don't have the 'fall-through' behavior of C, I would also 
> assume that you could associate more than one value with a case, i.e.:
> 
>     case 'a', 'b', 'c':
>        ...

Multiple values could be written

   case 'a':
   case 'b':
   case 'c':
     ...

without conflicting with the no-fallthrough semantics, since
a do-nothing case can be written as

   case 'd':
     pass

> I don't have any specific syntax proposals, but I notice that the suite 
> that follows the switch statement is not a normal suite, but a 
> restricted one,

I don't see that as a problem. And all the proposed syntaxes
I've ever seen for putting the cases at the same level as
the switch look ugly to me.

--
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