<div dir="ltr">MacroPy has it:<div><br></div><div><a href="https://github.com/lihaoyi/macropy#pattern-matching">https://github.com/lihaoyi/macropy#pattern-matching</a><br></div><div><br></div><div>=)</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Feb 10, 2014 at 6:31 AM, Sturla Molden <span dir="ltr"><<a href="mailto:sturla.molden@gmail.com" target="_blank">sturla.molden@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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>
Would this be something to consider for the standard lib, e.g. contextlib?<br>
<br>
Sturla<br>
<br>
_______________________________________________<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>
</blockquote></div><br></div>