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

[Python-Dev] Switch statement

[Python-Dev] Switch statement [Python-Dev] Switch statementGeorg Brandl g.brandl at gmx.net
Thu Jun 22 17:29:27 CEST 2006
Guido van Rossum wrote:

>> I've also been wondering whether the 'case' keyword is really necessary?
>>   Would any ambiguities or other parsing problems arise if you wrote:
>>
>>      switch x:
>>          1: foo(x)
>>         2: bar(x)
>>
>> It is debatable whether this is more or less readable, but it seemed
>> like an interesting question for the language lawyers.
> 
> That's no problem for the parser, as long as the expressions are
> indented. ABC did this.
> 
> But I think I like an explicit case keyword better; it gives a better
> error message if the indentation is forgotten.

It also overthrows the notion that suites are started by statements, not
by expressions.

Georg

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