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

[Python-Dev] PEP 3103: A Switch/Case Statement

[Python-Dev] PEP 3103: A Switch/Case Statement [Python-Dev] PEP 3103: A Switch/Case StatementJosiah Carlson jcarlson at uci.edu
Wed Jun 28 09:23:45 CEST 2006
Talin <talin at acm.org> wrote:
> My version of this is to add to Python the notion of a simple 
> old-fashioned subroutine - that is, a function with no arguments and no 
> additional scope, which can be referred to by name. For example:

I don't like the idea of an embedded subrutine for a few reasons.  One
of them is because you need to define the case -> sub mapping
dictionaries in each pass, you are getting no improvement in speed
(which is a motivating factor in this discussion).  Even worse, the
disconnect between case definition and dispatch makes it feel quite a
bit like a modified label/goto proposal.  The ultimate killer is that
your proposed syntax (even using def) make this construct less readable
than pretty much any if/elif/else chain I have ever seen.

 - Josiah

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