Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41042 > unrolled thread

RE: Switch statement

Started by"Joseph L. Casale" <jcasale@activenetwerx.com>
First post2013-03-10 22:18 +0000
Last post2013-03-10 22:18 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: Switch statement "Joseph L. Casale" <jcasale@activenetwerx.com> - 2013-03-10 22:18 +0000

#41042 — RE: Switch statement

From"Joseph L. Casale" <jcasale@activenetwerx.com>
Date2013-03-10 22:18 +0000
SubjectRE: Switch statement
Message-ID<mailman.3171.1362953935.2939.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

> Or could you do something like:
>
> arguments_to_pass = [list of some sort]
> switch.get(var, default)(*arguments_to_pass)

Stevens lambda suggestion was most appropriate. Within the switch, there
are functions called with none, or some variation of arguments. It was not
easy to pass them in after the fact, especially since the same function may
have different args depending on which case.

The lamda worked well.

Thanks guys!
jlc

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web