<div dir="ltr">Probably not. When I wrote PyExt, it was with the sole idea that you can get around stuff by abusing Python's reflection mechanisms. Even the code for the switch statement is very hackish. I don't quite think that belongs in stdlib.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 10, 2014 at 8: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><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>