Re: Switch function

2019-02-03 Thread Dan Sommers
On 2/3/19 9:03 PM, Avi Gross wrote: > The example I show above could in many cases be done as you describe > but what are you gaining? > > I mean if I subtract the integer representation of a keyboard > alphabetic letter (ASCII for the example) from letter 'a' or 'A' then > A maps to 0 and B maps

RE: Switch function

2019-02-03 Thread Avi Gross
list On Behalf Of Dan Sommers Sent: Sunday, February 3, 2019 8:29 PM To: python-list@python.org Subject: Re: Switch function On 2/3/19 5:40 PM, Avi Gross wrote: > Bottom line, does anyone bother using anything like this? It is > actually a bunch of hidden IF statements matched in order bu

Re: Switch function

2019-02-03 Thread Dan Sommers
On 2/3/19 5:40 PM, Avi Gross wrote: Bottom line, does anyone bother using anything like this? It is actually a bunch of hidden IF statements matched in order but may meet many needs. I sure don't. In the rare case that I might use a switch statement in another language, I just use a series of

Switch function

2019-02-03 Thread Avi Gross
Message asking about a fairly simple way to implement a switch in python as per the ongoing discussion. I wrote a function that might emulate a fairly simple general use of switch. A function would take N+2 arguments of the form: 1: something to switch based on 2,3: something to match to