<div dir="ltr">Because it doesn't <i>look </i>like one.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 11, 2014 at 9:25 AM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Wed, Feb 12, 2014 at 2:22 AM, Ryan Gonzalez <<a href="mailto:rymg19@gmail.com">rymg19@gmail.com</a>> wrote:<br>


> It looks cooler. It also feels slightly less aggravating.<br>
><br>
><br>
> On Mon, Feb 10, 2014 at 5:29 PM, Greg Ewing <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>><br>
> wrote:<br>
>><br>
>> Sturla Molden wrote:<br>
>>><br>
>>> I've noticed that PyExt has a switch statement implemented as a context<br>
>>> manager.<br>
>>><br>
>>> with switch(foobar):<br>
>>>     if case(1): pass<br>
>>>     if case(2): pass<br>
>><br>
>><br>
>> What advantage does this have over an if-else chain?<br>
>><br>
><br>
<br>
</div>Since it fundamentally _is_ an if chain (without the elses), how does<br>
it feel less aggravating than one?<br>
<br>
ChrisA<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Ryan<div><div>If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was nul-terminated."</div>

</div><div><br></div></div>
</div>