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

[Python-Dev] Switch statement

[Python-Dev] Switch statementTalin talin at acm.org
Thu Jun 22 03:56:49 CEST 2006
Phillip J. Eby wrote:
> At 09:55 AM 6/21/2006 -0700, Guido van Rossum wrote:
> 
>>BTW a switch in a class should be treated the same as a global switch.
>>But what about a switch in a class in a function?
> 
> 
> Okay, now my head hurts.  :)
> 
> A switch in a class doesn't need to be treated the same as a global switch, 
> because locals()!=globals() in that case.
> 
> I think the top-level is the only thing that really needs a special case 
> vs. the general "error if you use a local variable in the expression" rule.
> 
> Actually, it might be simpler just to always reject local variables -- even 
> at the top-level -- and be done with it.

I don't get what the problem is here. A switch constant should have 
exactly the bahavior of a default value of a function parameter. We 
don't seem to have too many problems defining functions at the module 
level, do we?

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