11 Feb
2014
11 Feb
'14
10:22 p.m.
Skip Montanaro wrote:
On Tue, Feb 11, 2014 at 10:58 AM, Philipp A. <flying-sheep@web.de> wrote:
the problem of a real switch statement is apparently that there’s no good syntax
Last time this was discussed at length, the main sticking point seemed to be that people generally expect a switch statement to be implemented by something more efficient than a series of if-tests. But that's extremely difficult to do in Python except when all of the case values are literals, which is a very special situation. So in general, any switch statement in Python would just be pure syntactic sugar for an if-else chain, and that doesn't seem to be considered enough of an advantage to bother with. -- Greg