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

[Python-Dev] Switch statement

[Python-Dev] Switch statement [Python-Dev] Switch statementNicko van Someren nicko at nicko.org
Fri Jun 16 00:45:40 CEST 2006
On 15 Jun 2006, at 11:37, Nick Coghlan wrote:
> ...
> The lack of a switch statement doesn't really bother me personally,  
> since I
> tend to just write my state machine type code so that it works off a
> dictionary that I define elsewhere,

Not trying to push more LISP into python or anything, but of course  
we could converge your method and the switch statement elegantly if  
only we could put whole suites into lamdbas rather than just single  
expressions :-)

{"case1": lamdba : some-suite-lambda... ,
  "case2": lambda : some-other-suite...
}[switch-condition-expression]()

	Nicko

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