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

[Python-Dev] Simple Switch statement

[Python-Dev] Simple Switch statement [Python-Dev] Simple Switch statementFredrik Lundh fredrik at pythonware.com
Mon Jun 26 08:07:54 CEST 2006
Guido van Rossum wrote:

> Here's an argument for allowing names (this argument has been used
> successfully for using names instead of string literals in many APIs):
> if there is a spelling error in the string literal, the case will
> silently be ignored, and who knows when the bug is detected. If there
> is a spelling error in a NAME, however, the error will be caught as
> soon as it is evaluated.

which is the rationale for using names in SRE, of course.

and adding a proper switch statement will make this approach a bit 
robust; if all cases are marked as static (or made static by default), 
all case expressions will be evaluated up front.

</F>

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