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/2005-April/052947.html below:

[Python-Dev] Re: switch statement

[Python-Dev] Re: switch statement [Python-Dev] Re: switch statementGreg Ewing greg.ewing at canterbury.ac.nz
Tue Apr 26 07:00:21 CEST 2005
Donovan Baarda wrote:

> Agreed. I don't find any switch syntaxes better than if/elif/else. Speed
> benefits belong in implementation optimisations, not new bad syntax.
> 

Two things are mildly annoying about if-elif chains as a
substitute for a switch statement:

1) Repeating the name of the thing being switched on all the time,
    and the operator being used for comparison.

2) The first case is syntactically different from subsequent ones,
    even though semantically all the cases are equivalent.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+
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