<p dir="ltr"><br>
On Apr 22, 2014 8:28 AM, "Lucas Malor" <<a href="mailto:7vsfeu4pxg@snkmail.com">7vsfeu4pxg@snkmail.com</a>> wrote:<br>
><br>
> Sorry, I didn't read it carefully. Anyway, youe example can be written as:<br>
><br>
>> for i in range(5):<br>
>> print(i, end=' => ')<br>
>> if i == 1:<br>
>> print('one')<br>
>> elif i == (2,3):<br>
>> print('tuple(two, three)')<br>
>> elif i in (2, 3):<br>
>> print('two or three')<br>
>> elif i > 3:<br>
>> print('more than three')<br>
>> else:<br>
>> print('unmatched')<br>
><br>
> and it's much simpler to read. I suggested the switch statement for a simpler alternative to the if-elif chain.</p>
<p dir="ltr"><sigh> My code can be written as a series of static print statements too and that would be even easier to read. It's an *example* to illustrate use not actual useful code!</p>
<p dir="ltr">My point is that this Case class does what you want with no language changes. And looking at your sample above exactly how would your new switch statement be better than either my code or your if/elif chain?</p>
<p dir="ltr">--- Bruce<br>
(from my phone)<br>
</p>